From: Amos Jeffries Date: Tue, 3 Jun 2014 08:52:29 +0000 (-0600) Subject: Add TCP_TUNNEL log code for CONNECT tunnels which are not SSL-bumped X-Git-Tag: SQUID_3_5_0_1~206 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a713747632511d9e5c12dd36cfe888e09a5c491;p=thirdparty%2Fsquid.git Add TCP_TUNNEL log code for CONNECT tunnels which are not SSL-bumped --- diff --git a/src/LogTags.h b/src/LogTags.h index 735a4d4057..3b7f0daaf7 100644 --- a/src/LogTags.h +++ b/src/LogTags.h @@ -26,6 +26,7 @@ typedef enum { LOG_TCP_DENIED_REPLY, LOG_TCP_OFFLINE_HIT, LOG_TCP_REDIRECT, + LOG_TCP_TUNNEL, // a binary tunnel was established for this transaction LOG_UDP_HIT, LOG_UDP_MISS, LOG_UDP_DENIED, diff --git a/src/client_side_request.cc b/src/client_side_request.cc index a84320a603..d5a1cbd1ae 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1524,7 +1524,6 @@ ClientHttpRequest::processRequest() return; } #endif - logType = LOG_TCP_MISS; getConn()->stopReading(); // tunnels read for themselves tunnelStart(this, &out.size, &al->http.code, al); return; diff --git a/src/tunnel.cc b/src/tunnel.cc index 0ba51faf74..ffabddbd77 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -48,6 +48,7 @@ #include "HttpRequest.h" #include "HttpStateFlags.h" #include "ip/QosConfig.h" +#include "LogTags.h" #include "MemBuf.h" #include "PeerSelectState.h" #include "SquidConfig.h" @@ -157,7 +158,8 @@ public: }; Connection client, server; - int *status_ptr; /* pointer to status for logging */ + int *status_ptr; ///< pointer for logging HTTP status + LogTags *logTag_ptr; ///< pointer for logging Squid processing code MemBuf *connectRespBuf; ///< accumulates peer CONNECT response when we need it bool connectReqWriting; ///< whether we are writing a CONNECT request to a peer @@ -708,6 +710,7 @@ tunnelStartShoveling(TunnelStateData *tunnelState) { assert(!tunnelState->waitingForConnectExchange()); *tunnelState->status_ptr = Http::scOkay; + *tunnelState->logTag_ptr = LOG_TCP_TUNNEL; if (cbdataReferenceValid(tunnelState)) { // Shovel any payload already pushed into reply buffer by the server response @@ -929,6 +932,7 @@ tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr, const tunnelState->request = request; tunnelState->server.size_ptr = size_ptr; tunnelState->status_ptr = status_ptr; + tunnelState->logTag_ptr = &http->logType; tunnelState->client.conn = http->getConn()->clientConnection; tunnelState->http = http; tunnelState->al = al;