From: Christos Tsantilas Date: Tue, 11 Jun 2013 14:55:34 +0000 (-0600) Subject: Fix request headers logging for icap_log X-Git-Tag: SQUID_3_3_6~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea22f05f6f5858147884b51e55394ff004a3d666;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 a6d3259d70..1520dfce7d 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -1254,9 +1254,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,8 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() al.cache.caddr = request_->client_addr; al.request = HTTPMSGLOCK(request_); + al.adapted_request = HTTPMSGLOCK(adapted_request_); + if (reply_) al.reply = HTTPMSGLOCK(reply_); else @@ -1313,7 +1317,7 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() packerClean(&p); mb.clean(); } - prepareLogWithRequestDetails(request_, alep); + prepareLogWithRequestDetails(adapted_request_, alep); Xaction::finalizeLogInfo(); }