squid store io modifications: a small fix

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 19 Jan 2000 00:54:42 +0100

Yet another small fix to the store I/O modifications.

/Henrik

* squid-2.2.STABLE5.log_ip_on_direct.patch *

Wed Jan 19 00:33:47 CET 2000
Modified Files in squid/src
        ssl.c

The squid-2.2.STABLE4.log_ip_on_direct.patch wasn't corretly done for
SSL (CONNECT method). Instead of logging the IP address it only logged
"-".

Squid-2.2.STABLE4: Log destination IP on DIRECT
    This patch logs the destination IP as part of the hierarchy
    tag in access.log when going direct. This has been requested by
    a number of people from accounting reasons, and logging the hostname
    is mostly redundant as it is part of the URL as well.

Index: squid/src/forward.c
diff -u squid/src/forward.c:1.1.1.14.2.7 squid/src/forward.c:1.1.1.14.2.8
--- squid/src/forward.c:1.1.1.14.2.7 Tue Jul 13 01:16:06 1999
+++ squid/src/forward.c Tue Jul 13 01:24:18 1999
@@ -190,6 +190,10 @@
         comm_close(server_fd);
     } else {
         debug(17, 3) ("fwdConnectDone: FD %d: '%s'\n", server_fd, storeUrl(fwdState->entry));
+ if (fs->peer)
+ hierarchyNote(&fwdState->request->hier, fs->code, fs->peer->host);
+ else
+ hierarchyNote(&fwdState->request->hier, fs->code, fd_table[server_fd].ipaddr);
         fd_note(server_fd, storeUrl(fwdState->entry));
         fd_table[server_fd].uses++;
         if (fs->peer)
@@ -242,7 +246,6 @@
         host = fwdState->request->host;
         port = fwdState->request->port;
     }
- hierarchyNote(&fwdState->request->hier, fs->code, host);
     if ((fd = pconnPop(host, port)) >= 0) {
         debug(17, 3) ("fwdConnectStart: reusing pconn FD %d\n", fd);
         fwdState->server_fd = fd;
Index: squid/src/ssl.c
diff -u squid/src/ssl.c:1.1.1.22 squid/src/ssl.c:1.1.1.22.2.3
--- squid/src/ssl.c:1.1.1.22 Sun Oct 24 20:22:11 1999
+++ squid/src/ssl.c Wed Jan 19 00:33:46 2000
@@ -371,6 +371,13 @@
     SslStateData *sslState = data;
     request_t *request = sslState->request;
     ErrorState *err = NULL;
+ if (sslState->servers->peer) {
+ hierarchyNote(&sslState->request->hier, sslState->servers->code,
+ sslState->servers->peer->host);
+ } else {
+ hierarchyNote(&sslState->request->hier, sslState->servers->code,
+ fd_table[sslState->server.fd].ipaddr);
+ }
     if (status == COMM_ERR_DNS) {
         debug(26, 4) ("sslConnect: Unknown host: %s\n", sslState->host);
         err = errorCon(ERR_DNS_FAIL, HTTP_NOT_FOUND);
@@ -534,9 +547,6 @@
         sslState->delay_id = 0;
     }
 #endif
- hierarchyNote(&sslState->request->hier,
- fs->peer ? fs->code : DIRECT,
- sslState->host);
     commConnectStart(sslState->server.fd,
         sslState->host,
         sslState->port,
Received on Tue Jan 18 2000 - 16:55:24 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:20 MST