mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Bug 1326136 - Let nsHttpConnection close it's transaction on shutdown. r=mcmanus
--HG-- extra : rebase_source : 64ace3aba1174b82d74d3b872395dcc9e44c8a12
This commit is contained in:
parent
3ab75c053f
commit
161afb3eae
@ -1594,7 +1594,8 @@ nsHttpConnection::Version()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void
|
||||
nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
|
||||
nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, nsresult reason,
|
||||
bool aIsShutdown)
|
||||
{
|
||||
LOG(("nsHttpConnection::CloseTransaction[this=%p trans=%p reason=%x]\n",
|
||||
this, trans, reason));
|
||||
@ -1630,7 +1631,7 @@ nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
|
||||
}
|
||||
|
||||
if (NS_FAILED(reason) && (reason != NS_BINDING_RETARGETED)) {
|
||||
Close(reason);
|
||||
Close(reason, aIsShutdown);
|
||||
}
|
||||
|
||||
// flag the connection as reused here for convenience sake. certainly
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
|
||||
// nsAHttpConnection compatible methods (non-virtual):
|
||||
nsresult OnHeadersAvailable(nsAHttpTransaction *, nsHttpRequestHead *, nsHttpResponseHead *, bool *reset);
|
||||
void CloseTransaction(nsAHttpTransaction *, nsresult reason);
|
||||
void CloseTransaction(nsAHttpTransaction *, nsresult reason, bool aIsShutdown = false);
|
||||
void GetConnectionInfo(nsHttpConnectionInfo **ci) { NS_IF_ADDREF(*ci = mConnInfo); }
|
||||
nsresult TakeTransport(nsISocketTransport **,
|
||||
nsIAsyncInputStream **,
|
||||
|
@ -2145,7 +2145,10 @@ nsHttpConnectionMgr::OnMsgShutdown(int32_t, ARefBase *param)
|
||||
RefPtr<nsHttpConnection> conn(ent->mActiveConns[0]);
|
||||
ent->mActiveConns.RemoveElementAt(0);
|
||||
DecrementActiveConnCount(conn);
|
||||
conn->Close(NS_ERROR_ABORT, true);
|
||||
// Since nsHttpConnection::Close doesn't break the bond with
|
||||
// the connection's transaction, we must explicitely tell it
|
||||
// to close its transaction and not just self.
|
||||
conn->CloseTransaction(conn->Transaction(), NS_ERROR_ABORT, true);
|
||||
}
|
||||
|
||||
// Close all idle connections.
|
||||
|
Loading…
x
Reference in New Issue
Block a user