nsresult rv;
nsresult rv = GetStatus(); if (NS_FAILED(rv)) return rv;
nsAsyncStreamListener::OnDataAvailable(nsIChannel* channel, nsISupports* context,                                       nsIInputStream *aIStream,                                        PRUint32 aSourceOffset,                                       PRUint32 aLength){    nsresult rv;    nsOnDataAvailableEvent* event =         new nsOnDataAvailableEvent(this, channel, context);    if (event == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    rv = event->Init(aIStream, aSourceOffset, aLength);    if (NS_FAILED(rv)) goto failed;#if defined(PR_LOGGING)    PLEventQueue *equeue;    mEventQueue->GetPLEventQueue(&equeue);    if (!gStreamEventLog)      gStreamEventLog = PR_NewLogModule("netlibStreamEvent");    PR_LOG(gStreamEventLog, PR_LOG_DEBUG,           ("nsAsyncStreamObserver: Data [this=%x queue=%x event=%x]",            this, equeue, event));#endif    rv = event->Fire(mEventQueue);    if (NS_FAILED(rv)) goto failed;    return rv;  failed:    delete event;    return rv;}