if (NS_FAILED(rv = NS_OpenURL(aURL, &in, nsnull )))
nsIInputStream* in; rv = NS_OpenURL(aURL, &in, nsnull );
rdf_BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer){    nsresult rv;    // XXX I really hate the way that we're spoon-feeding this stuff    // to the parser: it seems like this is something that netlib    // should be able to do by itself.    nsIInputStream* in;#ifdef NECKO    if (NS_FAILED(rv = NS_OpenURI(&in, aURL, nsnull /* XXX aConsumer */)))#else    if (NS_FAILED(rv = NS_OpenURL(aURL, &in, nsnull /* XXX aConsumer */)))#endif    {        NS_ERROR("unable to open blocking stream");        return rv;    }    NS_ASSERTION(in != nsnull, "no input stream");    if (! in) return NS_ERROR_FAILURE;    rv = NS_ERROR_OUT_OF_MEMORY;    ProxyStream* proxy = new ProxyStream();    if (! proxy)        goto done;#ifndef NECKO   // XXX I'm assuming necko will do this now    // XXX shouldn't netlib be doing this???    aConsumer->OnStartRequest(aURL, "text/rdf");#endif    while (PR_TRUE) {        char buf[1024];        PRUint32 readCount;        if (NS_FAILED(rv = in->Read(buf, sizeof(buf), &readCount)))            break; // error or eof        if (readCount == 0)            break; // eof        proxy->SetBuffer(buf, readCount);#ifndef NECKO   // XXX I'm assuming necko will do this now        // XXX shouldn't netlib be doing this???        rv = aConsumer->OnDataAvailable(aURL, proxy, readCount);#endif        if (NS_FAILED(rv))            break;    }    if (rv == NS_BASE_STREAM_EOF) {        rv = NS_OK;    }#ifndef NECKO   // XXX I'm assuming necko will do this now    // XXX shouldn't netlib be doing this???    aConsumer->OnStopRequest(aURL, 0, nsnull);#endifdone:    NS_RELEASE(in);    return rv;}