httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Murcko <ch...@n2k.com>
Subject WWW Form Bug Report: "Bug in Proxy Cacheing WRT NoCache directive" on OTHER:SINIX SVR4 (fwd)
Date Fri, 29 Nov 1996 21:47:47 GMT
Um, no. proxyhost is either the name of an upstream proxy, or NULL, indicating
that the host should be contacted directly.

host will always be the next host to contact, and that's what NoCache checks
to see if it should cache or not by list matches.

OTOH, maybe there's a pointer problem here that only SINIX users see.

NoCache is working fine on a mix of hosts that I test and use, including IRIX
(sort of SVR4) and Solaris (supposed to be SVR4ish). All of these are set
up not to cache entries in the local domain.

> 
> Message-Id: <199611291826.KAA26083@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 -----

chuck
Chuck Murcko	N2K Inc.	Wayne PA	chuck@telebase.com
And now, on a lighter note:
Xerox does it again and again and again and ...

Mime
View raw message