Bug 707662 - spdy null deref halfopen-transportstatus r=honzab

This commit is contained in:
Patrick McManus 2011-12-06 09:43:09 -05:00
parent b37128b41e
commit c213fb48f7

View File

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