Hello,
I have been trying to implement transparent proxy with a Linux box (ver
2.0.33) and ipfwadm (2.3).  I have the redirects going, but Squid responds
with an "error, invalid url ...", a sample out of the log files
893239266.136    169 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
893239689.986    120 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
893239844.409    132 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
893239876.732    106 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
893241112.803    119 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
893241124.885    116 202.76.95.229 ERR_INVALID_URL/400 546 GET / - NONE/- -
At the last minute I caught a requirement (?) to patch the distribution
with squid-1_1_20_host_and_virtual.patch.  I tried to patch it, but keep
getting the following error.  I have also included the "cat" of the saved
reject file below , (sorry about all this text).  
I would appreciate any help on this, thanks in advance.
SFQ
GOS
host:/usr/local/src# patch < /usr/local/squid-1_1_20_host_and_virtual.patch 
Hmm...  Looks like a context diff to me...
The text leading up to this was:
--------------------------
|*** squid-1.1.21/src/icp.c.orig        Thu Dec 18 05:58:54 1997
|--- squid-1.1.21/src/icp.c     Thu Jan 29 23:08:51 1998
--------------------------
Patching file squid-1.1.21/src/icp.c using Plan A...
Hunk #1 failed at 1682.
(Fascinating--this is really a new-style context diff but without
the telltale extra asterisks on the *** line that usually indicate
the new style...)
Hunk #2 failed at 1698.
2 out of 2 hunks failed--saving rejects to squid-1.1.21/src/icp.c.rej
done
 cat icp.c.rej |more
***************
*** 1682,1698
        *t = '\0';
      /* see if we running in httpd_accel_mode, if so got to convert it to
URL */
      if (httpd_accel_mode && *url == '/') {
!       /* prepend the accel prefix */
!       if (vhost_mode) {
!           /* Put the local socket IP address as the hostname */
!           url_sz = strlen(url) + 32 + Config.appendDomainLen;
!           icpState->url = xcalloc(url_sz, 1);
!           sprintf(icpState->url, "http://%s:%d%s",
!               inet_ntoa(icpState->me.sin_addr),
!               (int) Config.Accel.port,
!               url);
!           debug(12, 5, "VHOST REWRITE: '%s'\n", icpState->url);
!       } else if (opt_accel_uses_host && (t = mime_get_header(req_hdr,
"Host"))) {
            /* If a Host: header was specified, use it to build the URL 
             * instead of the one in the Config file. */
            /*
--- 1682,1689 -----
        *t = '\0';
      /* see if we running in httpd_accel_mode, if so got to convert it to
URL */
      if (httpd_accel_mode && *url == '/') {
!           /* prepend the accel prefix */
!       if (opt_accel_uses_host && (t = mime_get_header(req_hdr, "Host"))) {
            /* If a Host: header was specified, use it to build the URL 
             * instead of the one in the Config file. */
            /*
***************
*** 1707,1712 ****
            icpState->url = xcalloc(url_sz, 1);
            sprintf(icpState->url, "http://%s:%d%s",
                t, (int) Config.Accel.port, url);
        } else {
            url_sz = strlen(Config.Accel.prefix) + strlen(url) +
                Config.appendDomainLen + 1;
--- 1698,1712 ----
            icpState->url = xcalloc(url_sz, 1);
            sprintf(icpState->url, "http://%s:%d%s",
                t, (int) Config.Accel.port, url);
+       } else if (vhost_mode) {
+           /* Put the local socket IP address as the hostname */
+           url_sz = strlen(url) + 32 + Config.appendDomainLen;
+           icpState->url = xcalloc(url_sz, 1);
+           sprintf(icpState->url, "http://%s:%d%s",
+               inet_ntoa(icpState->me.sin_addr),
+               (int) Config.Accel.port,
+               url);
+           debug(12, 5, "VHOST REWRITE: '%s'\n", icpState->url);
        } else {
            url_sz = strlen(Config.Accel.prefix) + strlen(url) +
                Config.appendDomainLen + 1;
Received on Wed Apr 22 1998 - 12:48:33 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:39:55 MST