Bug 1904168 - Make sure fallback connection work, r=necko-reviewers,jesup, a=dmeehan

Differential Revision: https://phabricator.services.mozilla.com/D215016
This commit is contained in:
Kershaw Chang 2024-06-26 20:02:34 +00:00
parent d3622196fe
commit ad52ac4c27

View File

@ -70,10 +70,15 @@ nsresult SpeculativeTransaction::ReadSegments(nsAHttpSegmentReader* aReader,
void SpeculativeTransaction::Close(nsresult aReason) {
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
LOG(("SpeculativeTransaction::Close %p aReason=%" PRIx32, this,
static_cast<uint32_t>(aReason)));
NullHttpTransaction::Close(aReason);
if (aReason == NS_BASE_STREAM_CLOSED) {
aReason = NS_OK;
}
if (mCloseCallback) {
mCloseCallback(mTriedToWrite && aReason == NS_BASE_STREAM_CLOSED);
mCloseCallback(mTriedToWrite && NS_SUCCEEDED(aReason));
mCloseCallback = nullptr;
}
}