Bug 525284 - When cancelling a HTTP transaction, abandon all its half-open sockets r=mcmanus

This commit is contained in:
Tim Taubert 2014-08-30 10:24:36 +02:00
parent a2f41dce6e
commit acab6146ae

View File

@ -2297,7 +2297,19 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, void *param)
nsHttpTransaction *temp = trans;
NS_RELEASE(temp); // b/c NS_RELEASE nulls its argument!
}
// Abandon all half-open sockets belonging to the given transaction.
for (uint32_t index = 0;
index < ent->mHalfOpens.Length();
++index) {
nsHalfOpenSocket *half = ent->mHalfOpens[index];
if (trans == half->Transaction()) {
ent->RemoveHalfOpen(half);
half->Abandon();
}
}
}
trans->Close(closeCode);
// Cancel is a pretty strong signal that things might be hanging