]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix indirect IP logging for transactions without a client connection (#129) (#136)
authorsquidadm <squidadm@users.noreply.github.com>
Sat, 20 Jan 2018 19:07:08 +0000 (08:07 +1300)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 20 Jan 2018 19:07:08 +0000 (08:07 +1300)
src/client_side_request.cc

index be124f3552c9ed0f72577e73de651ec723bfa68d..203f89d4699935aefc0edae7942c3649e4d86897 100644 (file)
@@ -488,9 +488,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;