httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From taka...@apache.org
Subject svn commit: r894430 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
Date Tue, 29 Dec 2009 16:25:32 GMT
Author: takashi
Date: Tue Dec 29 16:25:31 2009
New Revision: 894430

URL: http://svn.apache.org/viewvc?rev=894430&view=rev
Log:
tweak handling for default allowed ports

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=894430&r1=894429&r2=894430&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Tue Dec 29 16:25:31 2009
@@ -95,6 +95,11 @@
 {
     int i;
     int *list = (int *) conf->allowed_connect_ports->elts;
+    
+    if(apr_is_empty_array(conf->allowed_connect_ports)){
+        return port == APR_URI_HTTPS_DEFAULT_PORT
+               || port == APR_URI_SNEWS_DEFAULT_PORT;
+    }
 
     for(i = 0; i < conf->allowed_connect_ports->nelts; i++) {
     if(port == list[i])
@@ -251,17 +256,7 @@
     }
 
     /* Check if it is an allowed port */
-    if (c_conf->allowed_connect_ports->nelts == 0) {
-    /* Default setting if not overridden by AllowCONNECT */
-        switch (uri.port) {
-            case APR_URI_HTTPS_DEFAULT_PORT:
-            case APR_URI_SNEWS_DEFAULT_PORT:
-                break;
-            default:
-                 return ap_proxyerror(r, HTTP_FORBIDDEN,
-                                      "Connect to remote machine blocked");
-        }
-    } else if(!allowed_port(c_conf, uri.port)) {
+    if(!allowed_port(c_conf, uri.port)) {
               return ap_proxyerror(r, HTTP_FORBIDDEN,
                                    "Connect to remote machine blocked");
     }



Mime
View raw message