From: Alex Rousskov Date: Tue, 5 Apr 2011 21:39:53 +0000 (-0600) Subject: Fixed %dt logging in the presence of REQMOD. X-Git-Tag: take06~27^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a119c6adbd3db6e2abde97a142ec40ae865648b4;p=thirdparty%2Fsquid.git Fixed %dt logging in the presence of REQMOD. 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. --- diff --git a/src/client_side.cc b/src/client_side.cc index 52cf389d8c..0dbf73ddf4 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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; }