close socket in OnStopRequest, if still open, sr=mscott 173924, fixes leak of sockets when server drops connection

This commit is contained in:
bienvenu%nventure.com 2005-11-05 04:46:32 +00:00
Родитель 67daa6f91f
Коммит 1d0fdf58c9
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -447,6 +447,11 @@ NS_IMETHODIMP nsMsgProtocol::OnStopRequest(nsIRequest *request, nsISupports *ctx
// Drop notification callbacks to prevent cycles.
mCallbacks = 0;
mProgressEventSink = 0;
// Call CloseSocket(), in case we got here because the server dropped the
// connection while reading, and we never get a chance to get back into
// the protocol state machine via OnDataAvailable.
if (m_socketIsOpen)
CloseSocket();
return rv;
}