From: Christos Tsantilas Date: Tue, 11 Jun 2013 09:55:05 +0000 (+0300) Subject: Fix request headers logging for icap_log X-Git-Tag: SQUID_3_4_0_1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ecb654fdbb7f878ac96538dca63e4b2a1511374;p=thirdparty%2Fsquid.git Fix request headers logging for icap_log The %http::>h does not print the original request headers but the adapted request headers. Also the %http::>ha does not print adapted headers. --- diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index 47c781e252..71203b4dbd 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -1253,9 +1253,11 @@ void prepareLogWithRequestDetails(HttpRequest *, AccessLogEntry::Pointer &); void Adaptation::Icap::ModXact::finalizeLogInfo() { HttpRequest * request_ = NULL; + HttpRequest * adapted_request_ = NULL; HttpReply * reply_ = NULL; - if (!(request_ = dynamic_cast(adapted.header))) { - request_ = (virgin.cause? virgin.cause: dynamic_cast(virgin.header)); + request_ = (virgin.cause? virgin.cause: dynamic_cast(virgin.header)); + if (!(adapted_request_ = dynamic_cast(adapted.header))) { + adapted_request_ = request_; reply_ = dynamic_cast(adapted.header); } @@ -1270,6 +1272,9 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() al.request = request_; HTTPMSGLOCK(al.request); + al.adapted_request = adapted_request_; + HTTPMSGLOCK(al.adapted_request); + if (reply_) { al.reply = reply_; HTTPMSGLOCK(al.reply); @@ -1314,7 +1319,7 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() packerClean(&p); mb.clean(); } - prepareLogWithRequestDetails(request_, alep); + prepareLogWithRequestDetails(adapted_request_, alep); Xaction::finalizeLogInfo(); }