]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4653: %st lies about tunneled traffic volumes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 25 May 2017 12:44:00 +0000 (00:44 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 25 May 2017 12:44:00 +0000 (00:44 +1200)
Squid-5 and squid-4 does not count the "HTTP/1.1 200 Connection Established"
header size for %<st formatting code.

This is a Measurement Factory project

src/tunnel.cc

index 061f4839698a13317134e686147f143d2571eeb6..c3f9fc3210659fce46daa80a31af0dbdde5100ab 100644 (file)
@@ -899,7 +899,7 @@ tunnelStartShoveling(TunnelStateData *tunnelState)
  * Call the tunnelStartShoveling to start the blind pump.
  */
 static void
-tunnelConnectedWriteDone(const Comm::ConnectionPointer &conn, char *, size_t, Comm::Flag flag, int, void *data)
+tunnelConnectedWriteDone(const Comm::ConnectionPointer &conn, char *, size_t len, Comm::Flag flag, int, void *data)
 {
     TunnelStateData *tunnelState = (TunnelStateData *)data;
     debugs(26, 3, HERE << conn << ", flag=" << flag);
@@ -911,6 +911,11 @@ tunnelConnectedWriteDone(const Comm::ConnectionPointer &conn, char *, size_t, Co
         return;
     }
 
+    if (auto http = tunnelState->http.get()) {
+        http->out.headers_sz += len;
+        http->out.size += len;
+    }
+
     tunnelStartShoveling(tunnelState);
 }