fixes bug 137965 "Document contains no data on disconnect"

r=bbaetz sr=rpotts
This commit is contained in:
darin%netscape.com 2002-04-18 22:30:11 +00:00
Родитель 63aa41f7e8
Коммит 0e555d8ef4
1 изменённых файлов: 8 добавлений и 2 удалений

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

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