From: Amos Jeffries Date: Mon, 3 Aug 2015 09:36:20 +0000 (-0700) Subject: Fix fakeAConnectRequest() missing after rev.14206 X-Git-Tag: merge-candidate-3-v1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bd3c2a32c9fe5d87942bdd81cbc18df0994a554;p=thirdparty%2Fsquid.git Fix fakeAConnectRequest() missing after rev.14206 --- diff --git a/src/client_side.cc b/src/client_side.cc index 420ea87939..356f941573 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -3731,31 +3731,6 @@ httpsSslBumpAccessCheckDone(allow_t answer, void *data) connState->fakeAConnectRequest("ssl-bump", connState->in.buf); } -void -ConnStateData::fakeAConnectRequest(const char *reason, const SBuf &payload) -{ - // fake a CONNECT request to force connState to tunnel - static char ip[MAX_IPSTRLEN]; - clientConnection->local.toUrl(ip, sizeof(ip)); - // Pre-pend this fake request to the TLS bits already in the buffer - SBuf retStr; - retStr.append("CONNECT "); - retStr.append(ip); - retStr.append(" HTTP/1.1\r\nHost: "); - retStr.append(ip); - retStr.append("\r\n\r\n"); - retStr.append(payload); - in.buf = retStr; - bool ret = handleReadData(); - if (ret) - ret = clientParseRequests(); - - if (!ret) { - debugs(33, 2, "Failed to start fake CONNECT request for " << reason << " connection: " << clientConnection); - clientConnection->close(); - } -} - /** handle a new HTTPS connection */ static void httpsAccept(const CommAcceptCbParams ¶ms) @@ -4327,6 +4302,31 @@ ConnStateData::httpsPeeked(Comm::ConnectionPointer serverConnection) #endif /* USE_OPENSSL */ +void +ConnStateData::fakeAConnectRequest(const char *reason, const SBuf &payload) +{ + // fake a CONNECT request to force connState to tunnel + static char ip[MAX_IPSTRLEN]; + clientConnection->local.toUrl(ip, sizeof(ip)); + // Pre-pend this fake request to the TLS bits already in the buffer + SBuf retStr; + retStr.append("CONNECT "); + retStr.append(ip); + retStr.append(" HTTP/1.1\r\nHost: "); + retStr.append(ip); + retStr.append("\r\n\r\n"); + retStr.append(payload); + in.buf = retStr; + bool ret = handleReadData(); + if (ret) + ret = clientParseRequests(); + + if (!ret) { + debugs(33, 2, "Failed to start fake CONNECT request for " << reason << " connection: " << clientConnection); + clientConnection->close(); + } +} + /// check FD after clientHttp[s]ConnectionOpened, adjust HttpSockets as needed static bool OpenedHttpSocket(const Comm::ConnectionPointer &c, const Ipc::FdNoteId portType)