]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Identify and cache the local port after connect()
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Jun 2010 23:34:15 +0000 (11:34 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Jun 2010 23:34:15 +0000 (11:34 +1200)
This will be needed for debug traces, logging and outbound myport ACL.

TODO: do the same for the local address when requesting wildcard.
      at present it still shows 0.0.0.0:port.

src/client_side_request.cc
src/comm/ConnectStateData.cc

index 26093dda969adccc1496d3a7550b5defb7f7f876..35361a5412a8553acac7ed0cf6be8c504c294339 100644 (file)
@@ -541,7 +541,7 @@ ClientRequestContext::clientAccessCheck2()
         acl_checklist = clientAclChecklistCreate(Config.accessList.adapted_http, http);
         acl_checklist->nonBlockingCheck(clientAccessCheckDoneWrapper, this);
     } else {
-        debugs(85, 2, HERE << "No adapted_http_access configuration.");
+        debugs(85, 2, HERE << "No adapted_http_access configuration. default: ALLOW");
         clientAccessCheckDone(ACCESS_ALLOWED);
     }
 }
index 3f3005aa5600747059c102a4bead8d297f68629d..bccaf1e505d4d8417e7c5d9e72c2f56f905663c4 100644 (file)
@@ -137,10 +137,11 @@ ConnectStateData::connect()
         if (active->getPeer())
             active->getPeer()->stats.conn_open++;
 
-        /* TODO: remove this fd_table access. But old code still depends on fd_table flags to
+        /* TODO: remove these fd_table accesses. But old code still depends on fd_table flags to
          *       indicate the state of a raw fd object being passed around.
          */
         fd_table[active->fd].flags.open = 1;
+        active->local.SetPort(comm_local_port(active->fd));
 
         ipcacheMarkGoodAddr(host, active->remote);
         callCallback(COMM_OK, 0);