diff --git a/netwerk/protocol/http/src/nsHTTPRequest.cpp b/netwerk/protocol/http/src/nsHTTPRequest.cpp index 07bd6bc981db..5c4c21901ff1 100644 --- a/netwerk/protocol/http/src/nsHTTPRequest.cpp +++ b/netwerk/protocol/http/src/nsHTTPRequest.cpp @@ -833,12 +833,13 @@ nsHTTPPipelinedRequest::OnStopRequest (nsIChannel* channel, nsISupports* i_Conte nsresult nsHTTPPipelinedRequest::RestartRequest () { - nsresult rv = NS_ERROR_FAILURE; + nsresult rval = NS_ERROR_FAILURE; PR_LOG (gHTTPLog, PR_LOG_DEBUG, ("nsHTTPPipelinedRequest::RestartRequest () [this=%x], mTotalProcessed=%u\n", this, mTotalProcessed)); if (mTotalProcessed == 0) { + nsresult rv; // the pipeline just started - we still can attempt to recover nsCOMPtr trans = do_QueryInterface (mTransport, &rv); @@ -864,7 +865,7 @@ nsHTTPPipelinedRequest::RestartRequest () if (wasKeptAlive && mAttempts == 0 && NS_SUCCEEDED (channelStatus)) { - rv = NS_OK; + rval = NS_OK; mListener = nsnull; if (mOnStopDone) @@ -876,11 +877,11 @@ nsHTTPPipelinedRequest::RestartRequest () mHandler -> ReleaseTransport (mTransport, nsIHTTPProtocolHandler::DONTRECORD_CAPABILITIES, PR_TRUE); mTransport = null_nsCOMPtr (); - rv = WriteRequest (); + rval = WriteRequest (); } } } - return rv; + return rval; } nsresult diff --git a/netwerk/protocol/http/src/nsHTTPResponseListener.cpp b/netwerk/protocol/http/src/nsHTTPResponseListener.cpp index 6512127bf1a3..dcd7e8548460 100644 --- a/netwerk/protocol/http/src/nsHTTPResponseListener.cpp +++ b/netwerk/protocol/http/src/nsHTTPResponseListener.cpp @@ -588,7 +588,8 @@ nsHTTPServerListener::OnStopRequest (nsIChannel* channel, nsISupports* i_pContex ("nsHTTPServerListener::OnStopRequest [this=%x]." "\tStatus = %x, mDataReceived=%d\n", this, i_Status, mDataReceived)); - if (NS_SUCCEEDED (channelStatus) && NS_SUCCEEDED (i_Status) && !mDataReceived) + if (NS_SUCCEEDED (channelStatus) && !mDataReceived + && (NS_SUCCEEDED (i_Status) || i_Status == NS_ERROR_FAILURE)) // EOF or not a well-known error, like timeout { // no data has been received from the channel at all - must be due to the fact that the // server has dropped the connection on keep-alive