From 0e555d8ef418c65b07b704e25da832f5385b70fa Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Thu, 18 Apr 2002 22:30:11 +0000 Subject: [PATCH] fixes bug 137965 "Document contains no data on disconnect" r=bbaetz sr=rpotts --- netwerk/protocol/http/src/nsHttpTransaction.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/netwerk/protocol/http/src/nsHttpTransaction.cpp b/netwerk/protocol/http/src/nsHttpTransaction.cpp index 6d177d27691..66c14a2a98b 100644 --- a/netwerk/protocol/http/src/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/src/nsHttpTransaction.cpp @@ -268,9 +268,15 @@ nsHttpTransaction::OnStopTransaction(nsresult status) // if the connection was reset before we read any part of the response, // then we must try to restart the transaction. - if ((status == NS_ERROR_NET_RESET) && (mContentRead == 0)) { + if (status == NS_ERROR_NET_RESET) { + // if some data was read, then mask the reset error, so our listener + // will treat this as a normal failure. XXX we might want to map + // this error to a special error code to indicate that the transfer + // was abnormally interrupted. + if (mContentRead > 0) + status = NS_ERROR_ABORT; // if restarting fails, then we must notify our listener. - if (NS_SUCCEEDED(Restart())) + else if (NS_SUCCEEDED(Restart())) return NS_OK; }