squid access.log patch

From: Jurijs Dorofejevs <jurijs@dont-contact.us>
Date: Fri, 20 Aug 1999 10:43:42 +0300

Hi!

Now I'm writing patch for squid allowing writing Destination IP
address insted of URL into access.log

But following line returned right result only when squid connects
DIRECTly. When it connects to PARENT proxy - I get IP address of
parent proxy, not the destination host.

ic=ipcache_gethostbyname(al->hier.host, IP_LOOKUP_IF_MISS);

So, I think I need another function to make gethostbyname(), but
cannot obtain its name.
Maybe it calls ipcache_nbgethostbyname() ???

Anybody can help me?

here is patch............

*** access_log.c Thu Aug 19 19:11:21 1999
--- access_log.c.my Thu Aug 19 19:10:11 1999
***************
*** 169,179 ****
  accessLogSquid(AccessLogEntry * al, MemBuf * mb)
  {

      const char *client = NULL;
      if (Config.onoff.log_fqdn)
        client = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS);
      if (client == NULL)
        client = inet_ntoa(al->cache.caddr);
! memBufPrintf(mb, "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s",
        (int) current_time.tv_sec,
        (int) current_time.tv_usec / 1000,
        al->cache.msec,
--- 169,183 ----
  accessLogSquid(AccessLogEntry * al, MemBuf * mb)
  {
      const char *client = NULL;
+ const ipcache_addrs *ic;
+
+ ic=ipcache_gethostbyname(al->hier.host, IP_LOOKUP_IF_MISS);
+
      if (Config.onoff.log_fqdn)
        client = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS);
      if (client == NULL)
        client = inet_ntoa(al->cache.caddr);
! memBufPrintf(mb, "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s
%lu.%lu.%lu.%lu",
        (int) current_time.tv_sec,
        (int) current_time.tv_usec / 1000,
        al->cache.msec,
***************
*** 187,193 ****
        al->hier.ping.timedout ? "TIMEOUT_" : "",
        hier_strings[al->hier.code],
        al->hier.host,
! al->http.content_type);
  }
  
  static void
--- 191,201 ----
        al->hier.ping.timedout ? "TIMEOUT_" : "",
        hier_strings[al->hier.code],
        al->hier.host,
! al->http.content_type,
! ic->in_addrs[ic->cur].s_addr&255,
! (ic->in_addrs[ic->cur].s_addr>>8)&255,
! (ic->in_addrs[ic->cur].s_addr>>16)&255,
! (ic->in_addrs[ic->cur].s_addr>>24)&255);
  }
  

  

----------===================----------
            Jurijs Dorofejevs
        "Aizkraukles Banka Ltd."
  Information Technologies Department
     e-mail: jurijs@aizkraukles.com
Received on Fri Aug 20 1999 - 01:40:28 MDT

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