From 11797f5191463f55e4bb2f769c61b02a497789c8 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Thu, 1 Apr 1999 05:10:55 +0000 Subject: [PATCH] Fix some linux problems with mailnews. We were interrupting the stream twice when releasing a file transport. --- network/module/nsSocketTransport.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/network/module/nsSocketTransport.cpp b/network/module/nsSocketTransport.cpp index fedbd1f8d795..8f56adde3093 100644 --- a/network/module/nsSocketTransport.cpp +++ b/network/module/nsSocketTransport.cpp @@ -382,7 +382,20 @@ nsresult nsSocketTransport::CloseCurrentConnection() rv = NS_NewINetService(&pNetService, NULL); if (pNetService) { - rv = pNetService->InterruptStream(m_url); + // hmmm...if the underlying transport was a file socket, + // then we appear to be interrupting the stream twice: + // once by mkfile when it is done reading in the file + // and a second time when the protocol closes the transport. + // (which is how we get here). So if we are a file + // transport, we aren't going to interrupt the stream + // because it already has been interrupted. I'd like + // to find a cleaner way to do this (such as allowing + // you to safely interrupt the stream again) but I'm + // not sure how to do that yet. This hack is less + // risky... + + if (!m_isFileConnection) + rv = pNetService->InterruptStream(m_url); NS_RELEASE(pNetService); }