]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add TCP_TUNNEL log code for CONNECT tunnels which are not SSL-bumped
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Jun 2014 08:52:29 +0000 (02:52 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Jun 2014 08:52:29 +0000 (02:52 -0600)
src/LogTags.h
src/client_side_request.cc
src/tunnel.cc

index 735a4d40574e6fed9e6a59321d9ecaca06150bb2..3b7f0daaf734ce41e32a36d918c24f69e118ad96 100644 (file)
@@ -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,
index a84320a603397b48e35c09c41d618aa29a37cb51..d5a1cbd1ae851548c475450010532e3b73e169bc 100644 (file)
@@ -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;
index 0ba51faf74a11891fbf10fa4def6a522729600fa..ffabddbd778713032e062d5e8e6fbfe097a9c2be 100644 (file)
@@ -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;