Be more conservative when checking that the keep-alive connection has

died. On some platforms it can come out as eof and on some (windows)
it'll come out as "connection aborted".
This commit is contained in:
ruslan%netscape.com 2000-04-21 01:27:48 +00:00
Родитель 37ed433994
Коммит ddd06506fc
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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<nsISocketTransport> 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

Просмотреть файл

@ -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