*** ./http_protocol.c.orig	Mon Sep 28 16:07:17 1998
--- ./http_protocol.c	Wed Sep 23 09:07:31 1998
***************
*** 722,727 ****
--- 722,728 ----
      int len;
      unsigned int fields_read = 0;
      table *tmp_headers;
+     const char * forwarded_for;
  
      /* We'll use ap_overlap_tables later to merge these into r->headers_in. */
      tmp_headers = ap_make_table(r->pool, 50);
***************
*** 773,778 ****
--- 774,798 ----
      }
  
      ap_overlap_tables(r->headers_in, tmp_headers, AP_OVERLAP_TABLES_MERGE);
+ 
+     /**
+      * go2net hack to replace remote_ip when squid was involved.
+      */
+ 
+     forwarded_for = ap_table_get(r->headers_in, "X-Forwarded-For");
+     if (forwarded_for != NULL &&
+      (strncmp(c->remote_ip, "206.253.196", 11) == 0 ||
+       strncmp(c->remote_ip, "207.178.54", 10) == 0)) {
+ 
+ 	/* This might be a comma separated list... */
+ 	value = (char *)forwarded_for + strlen(forwarded_for);
+ 	while (value != forwarded_for &&
+ 	 (isdigit(*(value - 1)) || (*(value - 1) == '.'))) {
+ 	    value--;
+ 	}
+ 
+ 	c->remote_ip = ap_pstrdup(c->pool, value);
+     }
  }
  
  request_rec *ap_read_request(conn_rec *conn)