]> 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)
committerGitHub <noreply@github.com>
Fri, 19 Jan 2018 01:56:49 +0000 (14:56 +1300)
src/client_side_request.cc

index 737a269158cdb80f9cb11b9edae511b32ef8dce0..ac71c8874d596e2a65ed0d197a85d7da0ea7cc64 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;