From: Alex Rousskov Date: Mon, 22 Nov 2021 19:07:09 +0000 (+0000) Subject: Fix GCC v10 --with-openssl build after commit 030a9b3 (#935) X-Git-Tag: SQUID_6_0_1~267 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=084fa674b52fe6efe932deb3df013332ebc2cfad;p=thirdparty%2Fsquid.git Fix GCC v10 --with-openssl build after commit 030a9b3 (#935) bio.cc:377:18: warning: unused variable 'ssl' [-Wunused-variable] I removed the whole "we have a valid TLS connection" condition because the code in question no longer uses the TLS connection object, and the condition itself may change _after_ this code runs. The condition is important to higher-level code (that calls the code that uses allowSplice/allowBump state set in the affected low-level BIO method), but there are many such conditions on that code path; there is no good reason to single out this specific condition in this low-level code. --- diff --git a/src/ssl/bio.cc b/src/ssl/bio.cc index c01bb42ac4..dd7d8539e4 100644 --- a/src/ssl/bio.cc +++ b/src/ssl/bio.cc @@ -374,25 +374,23 @@ Ssl::ServerBio::write(const char *buf, int size, BIO *table) //Hello message is the first message we write to server assert(helloMsg.isEmpty()); - if (auto ssl = fd_table[fd_].ssl.get()) { - if (bumpMode_ == Ssl::bumpPeek) { - // we should not be here if we failed to parse the client-sent ClientHello - Must(!clientSentHello.isEmpty()); - allowSplice = true; - // Replace OpenSSL-generated ClientHello with client-sent one. - helloMsg.append(clientSentHello); - debugs(83, 7, "FD " << fd_ << ": Using client-sent ClientHello for peek mode"); - } else { /*Ssl::bumpStare*/ - allowBump = true; - } + if (bumpMode_ == Ssl::bumpPeek) { + // we should not be here if we failed to parse the client-sent ClientHello + Must(!clientSentHello.isEmpty()); + allowSplice = true; + // Replace OpenSSL-generated ClientHello with client-sent one. + helloMsg.append(clientSentHello); + debugs(83, 7, "FD " << fd_ << ": Using client-sent ClientHello for peek mode"); + } else { /*Ssl::bumpStare*/ + allowBump = true; } + // if we did not use the client-sent ClientHello, then use the OpenSSL-generated one if (helloMsg.isEmpty()) helloMsg.append(buf, size); helloBuild = true; helloMsgSize = helloMsg.length(); - //allowBump = true; if (allowSplice) { // Do not write yet.....