Hi.

After upgrading my server(s) to 4.1 I discovered my squid redirections do
not work anymore.

After some source digging I saw that squid passes the redirectors the query
in the following format

URL <SP> client_ip "/" fqdn <SP> user <SP> method <SP> urlgroup <NL>

but jesred expects only 4 parameters and concatenates with the fourth all
that follows.

I created this patch to solve the problem, hope it helps:

--- rewrite.c.orig      Thu Jun 21 15:34:14 2007
+++ rewrite.c   Thu Jun 21 15:40:20 2007
@@ -60,7 +60,8 @@
    int c, i;
    struct in_addr address;
    char *token, *new_token;
-    char *end[4];
+    char *end[5];
+       char *other;

    c = 0;
    token = strchr(buff,' ');
@@ -81,17 +82,24 @@
               *token = '\0';
               end[2] = token;
               *ident = new_token;
-               new_token = strchr(++token,'\n');
+               new_token = strchr(++token,' ');
               if (new_token) {
                   c++;
                   *new_token = '\0';
                   end[3] = new_token;
                   *method = token;
+                       token = strchr(++new_token,'\n');
+                       if (token) {
+                               c++;
+                               *token = '\0';
+                               end[4] = token;
+                               other = new_token;
+                       }
               }
           }
       }
    }
-    if(c != 4) {
+    if(c != 5) {
       for(i = 0; i < c; i++) {
           if ( end[i] )
               *end[i] = ' ';
@@ -100,7 +108,7 @@
       return 1;
    }
#ifdef DEBUG
-    log(DEBG, "Request: %s %s %s %s\n", *url, *src_addr, *ident, *method);
+    log(DEBG, "Request: %s %s %s %s %s\n", *url, *src_addr, *ident,
*method, other);
#endif

    /* all methods must be GET or ICP_QUERY */

Ciao,
D.

ps. Please CC me.

Reply via email to