mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out changeset 2c4c34f31021 (bug 1762911) for causing xpcshell failures at test_servers.js.
This commit is contained in:
parent
0f321c2172
commit
51e536fea5
@ -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;
|
||||
}
|
||||
|
@ -2367,6 +2367,7 @@ void nsHttpConnection::HandshakeDoneInternal() {
|
||||
Telemetry::Accumulate(Telemetry::SPDY_NPN_CONNECT, UsingSpdy());
|
||||
|
||||
mTlsHandshaker->FinishNPNSetup(true, true);
|
||||
Unused << ResumeSend();
|
||||
}
|
||||
|
||||
void nsHttpConnection::SetTunnelSetupDone() {
|
||||
|
Loading…
Reference in New Issue
Block a user