Skip to content

Commit

Permalink
Bug 525284 - When cancelling a HTTP transaction, abandon all its half…
Browse files Browse the repository at this point in the history
…-open sockets r=mcmanus
  • Loading branch information
Tim Taubert committed Aug 30, 2014
1 parent 62d5432 commit 0e42e71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions netwerk/protocol/http/nsHttpConnectionMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e42e71

Please sign in to comment.