From a119c6adbd3db6e2abde97a142ec40ae865648b4 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 5 Apr 2011 15:39:53 -0600 Subject: [PATCH] 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. --- src/client_side.cc | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.47.3