Backed out changeset 2c4c34f31021 (bug 1762911) for causing xpcshell failures at test_servers.js.

This commit is contained in:
Butkovits Atila 2022-10-20 01:44:42 +03:00
parent 0f321c2172
commit 51e536fea5
2 changed files with 12 additions and 17 deletions

View File

@ -36,14 +36,16 @@ TlsHandshaker::HandshakeDone() {
if (mOwner) {
mTlsHandshakeComplitionPending = true;
// nsHttpConnection needs to handle the handshake done, but it can not be
// done here because NSS still holds a lock. We will call
// nsHttpConnection::ForceSend which is the standard way to force the
// nsHttpConnection sending code path. nsHttpConnection::ForceSend
// dispatches nsHttpConnection::OnOutputStreamReady that will call
// TlsHandshaker::EnsureNPNComplete and further
// nsHttpConnection::HandshakeDoneInternal.
Unused << mOwner->ForceSend();
// HandshakeDone needs to be dispatched so that it is not called inside
// nss locks.
RefPtr<TlsHandshaker> self(this);
NS_DispatchToCurrentThread(NS_NewRunnableFunction(
"TlsHandshaker::HandshakeDoneInternal", [self{std::move(self)}]() {
if (self->mTlsHandshakeComplitionPending && self->mOwner) {
self->mOwner->HandshakeDoneInternal();
self->mTlsHandshakeComplitionPending = false;
}
}));
}
return NS_OK;
}
@ -179,9 +181,7 @@ bool TlsHandshaker::EnsureNPNComplete() {
}
if (mTlsHandshakeComplitionPending) {
mOwner->HandshakeDoneInternal();
mTlsHandshakeComplitionPending = false;
return true;
return false;
}
nsCOMPtr<nsISSLSocketControl> ssl;
@ -209,12 +209,6 @@ bool TlsHandshaker::EnsureNPNComplete() {
return true;
}
if (mTlsHandshakeComplitionPending) {
mOwner->HandshakeDoneInternal();
mTlsHandshakeComplitionPending = false;
return true;
}
Check0RttEnabled(ssl);
return false;
}

View File

@ -2367,6 +2367,7 @@ void nsHttpConnection::HandshakeDoneInternal() {
Telemetry::Accumulate(Telemetry::SPDY_NPN_CONNECT, UsingSpdy());
mTlsHandshaker->FinishNPNSetup(true, true);
Unused << ResumeSend();
}
void nsHttpConnection::SetTunnelSetupDone() {