You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/11/29 19:42:19 UTC

WWW Form Bug Report: "Bug in Proxy Cacheing WRT NoCache directive" on OTHER:SINIX SVR4 (fwd)


not acked

----- Forwarded message from Martin.Kraemer@mch.sni.de -----

Message-Id: <19...@taz.hyperreal.com>
From: Martin.Kraemer@mch.sni.de
To: apache-bugs%apache.org@organic.com
Date: Fri Nov 29 10:26:26 1996
Subject: WWW Form Bug Report: "Bug in Proxy Cacheing WRT NoCache directive" on OTHER:SINIX SVR4

Submitter: Martin.Kraemer@Mch.SNI.De
Operating system: OTHER:SINIX SVR4, version: SINIX-N 5.42
Version of Apache Used: apache-1.1.1
Extra Modules used: mod_proxy (and others unrelated to problem)
URL exhibiting problem: any outside of my.dom.ain

Symptoms:
--
Given a proxy firewall within my domain, the directive
"NoProxy my.dom.ain" inc combination with cacheing
enabled leads to the problem that no cacheing is done
any more because the no-cache-comparison compares
with the defined proxy host name, not with the
URL host name.
Patch:
--- apache111/src/mod_proxy.c   Wed Jul  3 17:02:58 1996                        
+++ /home10/martin/apache111/src/mod_proxy.c    Fri Nov 29 17:03:59 1996        
@@ -2776,6 +2791,7 @@                                                           
         (proxy_server_conf *)get_module_config(sconf, &proxy_module);          
     struct nocache_entry *ent=(struct nocache_entry *)conf->nocaches->elts;    
     int nocache = 0;                                                           
+    char *desthost = NULL;                                                     
                                                                                
     memset(&server, '\0', sizeof(server));                                     
     server.sin_family = AF_INET;                                               
@@ -2786,6 +2802,25 @@                                                          
        err = host2addr(proxyhost, &server.sin_addr);                           
        if (err != NULL) return DECLINED;  /* try another */                    
        host = proxyhost;                                                       
+                                                                               
+       desthost = url + 7;     /* skip http:// */                              
+       p = strchr(desthost, '/');                                              
+                                                                               
+       if (p == NULL)                                                          
+       {                                                                       
+           desthost = pstrdup(pool, desthost);                                 
+       }                                                                       
+       else                                                                    
+       {                                                                       
+           char *q = palloc(pool, p-desthost+1);                               
+           memcpy(q, desthost, p-desthost);                                    
+           q[p-desthost] = '\0';                                               
+           desthost = q;                                                       
+       }                                                                       
+       p = strchr(desthost, ':');                                              
+       if (p != NULL)                                                          
+           *p = '\0';                                                          
+                                                                               
     } else                                                                     
     {                                                                          
        url += 7;  /* skip http:// */                                           
@@ -2814,6 +2849,8 @@                                                           
        server.sin_port = htons(port);                                          
        err = host2addr(host, &server.sin_addr);                                
        if (err != NULL) return proxyerror(r, err); /* give up */               
+                                                                               
+       desthost = pstrdup(pool, host);                                         
     }                                                                          
                                                                                
     sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);                          
@@ -2935,8 +2972,11 @@                                                          
 /* check if NoCache directive on this host */                                  
     for (i=0; i < conf->nocaches->nelts; i++)                                  
     {                                                                          
-        if (ent[i].name != NULL && strstr(host, ent[i].name) != NULL)          
+       if (ent[i].name != NULL && strstr(desthost, ent[i].name) != NULL)       
+       {                                                                       
+           Explain2("nocache set: NoCache directive for \"%s\" on host \"%s\"",
 desthost, ent[i].name);                                                        
            nocache = 1;                                                        
+       }                                                                       
     }                                                                          
                                                                                
     i = cache_update(c, resp_hdrs, inprotocol, nocache);                       

--

Backtrace:
--

--

----- End of forwarded message from Martin.Kraemer@mch.sni.de -----

-- 
Rob Hartill.       Internet Movie Database Ltd.    http://www.imdb.com/