httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/modules/proxy proxy_ftp.c proxy_http.c
Date Fri, 09 Feb 2001 12:40:29 GMT
martin      01/02/09 04:40:29

  Modified:    src/modules/proxy proxy_ftp.c proxy_http.c
  Log:
  Order the checks for NoProxy and ProxyBlock in the order
  "fastest to slowest" (as was already partially done in proxy_http.c).
  Minor speed improvement.
  
  Revision  Changes    Path
  1.86      +15 -8     apache-1.3/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -u -r1.85 -r1.86
  --- proxy_ftp.c	2001/01/15 17:05:29	1.85
  +++ proxy_ftp.c	2001/02/09 12:40:27	1.86
  @@ -536,10 +536,11 @@
   /* check if ProxyBlock directive on this host */
       destaddr.s_addr = ap_inet_addr(host);
       for (i = 0; i < conf->noproxies->nelts; i++) {
  -	if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
  -	    || destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
  -	    return ap_proxyerror(r, HTTP_FORBIDDEN,
  -				 "Connect to remote machine blocked");
  +        if (destaddr.s_addr == npent[i].addr.s_addr ||
  +            (npent[i].name != NULL &&
  +              (npent[i].name[0] == '*' || strstr(host, npent[i].name) != NULL)))
  +            return ap_proxyerror(r, HTTP_FORBIDDEN,
  +                                 "Connect to remote machine blocked");
       }
   
       Explain2("FTP: connect to %s:%d", host, port);
  @@ -1158,10 +1159,16 @@
       }
   
   /* check if NoCache directive on this host */
  -    for (i = 0; i < conf->nocaches->nelts; i++) {
  -	if ((ncent[i].name != NULL && strstr(host, ncent[i].name) != NULL)
  -	    || destaddr.s_addr == ncent[i].addr.s_addr || ncent[i].name[0] == '*')
  -	    nocache = 1;
  +    if (nocache == 0) {
  +	for (i = 0; i < conf->nocaches->nelts; i++) {
  +	    if (destaddr.s_addr == ncent[i].addr.s_addr ||
  +	        (ncent[i].name != NULL &&
  +		  (ncent[i].name[0] == '*' ||
  +		   strstr(host, ncent[i].name) != NULL))) {
  +	       nocache = 1;
  +	       break;
  +	    }
  +	}
       }
   
       i = ap_proxy_cache_update(c, resp_hdrs, 0, nocache);
  
  
  
  1.73      +5 -4      apache-1.3/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -u -r1.72 -r1.73
  --- proxy_http.c	2001/01/15 17:05:30	1.72
  +++ proxy_http.c	2001/02/09 12:40:27	1.73
  @@ -233,10 +233,11 @@
   /* check if ProxyBlock directive on this host */
       destaddr.s_addr = ap_inet_addr(desthost);
       for (i = 0; i < conf->noproxies->nelts; i++) {
  -	if ((npent[i].name != NULL && strstr(desthost, npent[i].name) != NULL)
  -	    || destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*')
  -	    return ap_proxyerror(r, HTTP_FORBIDDEN,
  -				 "Connect to remote machine blocked");
  +        if (destaddr.s_addr == npent[i].addr.s_addr ||
  +            (npent[i].name != NULL &&
  +              (npent[i].name[0] == '*' || strstr(desthost, npent[i].name) != NULL)))
  +            return ap_proxyerror(r, HTTP_FORBIDDEN,
  +                                 "Connect to remote machine blocked");
       }
   
       if (proxyhost != NULL) {
  
  
  

Mime
View raw message