]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4653 - %st lies about tunneled traffic volumes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 18 May 2017 17:21:45 +0000 (20:21 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 18 May 2017 17:21:45 +0000 (20:21 +0300)
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 12bb6c6f610561abe7facfdb7f6bc111d5182d82..b92b4d07d8ebcb72e863748086c1b12e04057ccd 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);
 }