commit 30103ec4534d534205e46d914c88dd17c26f7c88 (refs/remotes/origin/v4.0) Author: Amos Jeffries Date: 2018-01-19 14:56:49 +1300 Fix indirect IP logging for transactions without a client connection (#129) diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 5cccffe..4b5ac98 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -499,9 +499,9 @@ clientFollowXForwardedForCheck(allow_t answer, void *data) * Ensure that the access log shows the indirect client * instead of the direct client. */ - ConnStateData *conn = http->getConn(); - conn->log_addr = request->indirect_client_addr; - http->al->cache.caddr = conn->log_addr; + http->al->cache.caddr = request->indirect_client_addr; + if (ConnStateData *conn = http->getConn()) + conn->log_addr = request->indirect_client_addr; } request->x_forwarded_for_iterator.clean(); request->flags.done_follow_x_forwarded_for = true;