]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed %dt logging in the presence of REQMOD.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 5 Apr 2011 21:39:53 +0000 (15:39 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 5 Apr 2011 21:39:53 +0000 (15:39 -0600)
We use LogEntry::request to save a virgin request for future logging. However,
when that request is adapted and replaced, the adapted request has all the
stats while the saved virgin request lacks them. We have already copied error
details from the adapted to logged/virgin request. Now we copy the DNS wait
time (%dt) as well.

TODO: Move statistics to a stand-alone history object that adapted and
virgin requests can share. Longer term, we should separate HttpRequest
from Master Transaction so that we can store virgin request details without
implicitly storing not-yet-collected master transaction stats.

src/client_side.cc

index 52cf389d8c42a7516ac703d0091527b0c1d8118f..0dbf73ddf462c58f701949e6ffe94e9067fedb00 100644 (file)
@@ -606,7 +606,11 @@ prepareLogWithRequestDetails(HttpRequest * request, AccessLogEntry * aLogEntry)
     }
 #endif
 
+    // Adapted request, if any, inherits and then collects all the stats, but
+    // the virgin request gets logged instead; copy the stats to log them.
+    // TODO: avoid losses by keeping these stats in a shared history object?
     if (aLogEntry->request) {
+        aLogEntry->request->dnsWait = request->dnsWait;
         aLogEntry->request->errType = request->errType;
         aLogEntry->request->errDetail = request->errDetail;
     }