From f54a57c679d576ce50b5bdd8d19329c927da5da3 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Tue, 6 Dec 2011 09:43:09 -0500 Subject: [PATCH] Bug 707662 - spdy null deref halfopen-transportstatus r=honzab --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 91e40e8ec63..8c7703af010 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -2096,16 +2096,22 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, { NS_ASSERTION(PR_GetCurrentThread() == gSocketThread, "wrong thread"); + if (mTransaction) + mTransaction->OnTransportStatus(trans, status, progress); + + if (trans != mSocketTransport) + return NS_OK; + // if we are doing spdy coalescing and haven't recorded the ip address // for this entry before then make the hash key if our dns lookup // just completed - if (gHttpHandler->IsSpdyEnabled() && + if (status == nsISocketTransport::STATUS_CONNECTED_TO && + gHttpHandler->IsSpdyEnabled() && gHttpHandler->CoalesceSpdy() && mEnt && mEnt->mConnInfo && mEnt->mConnInfo->UsingSSL() && !mEnt->mConnInfo->UsingHttpProxy() && - mEnt->mCoalescingKey.IsEmpty() && - status == nsISocketTransport::STATUS_CONNECTED_TO) { + mEnt->mCoalescingKey.IsEmpty()) { PRNetAddr addr; nsresult rv = mSocketTransport->GetPeerAddr(&addr); @@ -2130,12 +2136,6 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, } } - if (mTransaction) - mTransaction->OnTransportStatus(trans, status, progress); - - if (trans != mSocketTransport) - return NS_OK; - switch (status) { case nsISocketTransport::STATUS_CONNECTING_TO: // Passed DNS resolution, now trying to connect, start the backup timer