]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix indirect IP logging for transactions without a client connection (#129)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 19 Jan 2018 01:56:49 +0000 (14:56 +1300)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 19 Jan 2018 09:04:36 +0000 (22:04 +1300)
src/client_side_request.cc

index 5cccffeb958a562f572a039cce8089a850060bd3..4b5ac98fd5ee5a51307435361425abe4127eed9e 100644 (file)
@@ -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;