]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Log %<sS (reply content length) as zero when object size is unknown.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 26 Aug 2013 19:15:21 +0000 (13:15 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 26 Aug 2013 19:15:21 +0000 (13:15 -0600)
For %<sS purposes, Squid computes reply content length as the difference
between "object size" and response headers. When headers were received but the
"object size" is not known (e.g., the promissed response body was never
received), that computation results in misleading negative numbers. We no
longer log them.

src/client_side.cc

index d60a16490eb62420ead70e5ba1c04cc6440544fc..0fdfdd2c3fe564aff0961f33531839316f81cb33 100644 (file)
@@ -727,7 +727,7 @@ ClientHttpRequest::logRequest()
 
     debugs(33, 9, "clientLogRequest: http.code='" << al->http.code << "'");
 
-    if (loggingEntry() && loggingEntry()->mem_obj)
+    if (loggingEntry() && loggingEntry()->mem_obj && loggingEntry()->objectLen() >= 0)
         al->cache.objectSize = loggingEntry()->contentLen();
 
     al->cache.caddr.SetNoAddr();