Skip to content

Commit 2e66e3c

Browse files
committed
fix segfault
1 parent 8d3b0e3 commit 2e66e3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flow/Net2.actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ class SSLConnection final : public IConnection, ReferenceCounted<SSLConnection>
10661066
// If the background handshakers are not all busy, use one
10671067

10681068
// FIXME: see comment elsewhere about making this the only path.
1069-
if (FLOW_KNOBS->TLS_HANDSHAKE_ALWAYS_BACKGROUND ||
1069+
if ((FLOW_KNOBS->TLS_HANDSHAKE_ALWAYS_BACKGROUND && N2::g_net2->sslHandshakerThreadsStarted > 0) ||
10701070
N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) {
10711071
g_net2->countServerTLSHandshakesOnSideThreads++;
10721072
holder = Hold(&N2::g_net2->sslPoolHandshakesInProgress);
@@ -1184,7 +1184,7 @@ class SSLConnection final : public IConnection, ReferenceCounted<SSLConnection>
11841184
// much, much higher than the cost a few hundred or
11851185
// thousand incremental threads.
11861186

1187-
if (FLOW_KNOBS->TLS_HANDSHAKE_ALWAYS_BACKGROUND ||
1187+
if ((FLOW_KNOBS->TLS_HANDSHAKE_ALWAYS_BACKGROUND && N2::g_net2->sslHandshakerThreadsStarted > 0) ||
11881188
N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) {
11891189
g_net2->countClientTLSHandshakesOnSideThreads++;
11901190
holder = Hold(&N2::g_net2->sslPoolHandshakesInProgress);

0 commit comments

Comments
 (0)