]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Allow multiple IP addresses to be configured for the same secure port
authorBradley Nicholes <bnicholes@apache.org>
Wed, 25 Aug 2004 19:13:28 +0000 (19:13 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 25 Aug 2004 19:13:28 +0000 (19:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104802 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/netware/mod_nw_ssl.c

index 0d9e716cb77f5c6a372c18d3ebd0536e07389691..306c0be8076d6754d344567f47a2063fd5f1e746 100644 (file)
@@ -482,7 +482,7 @@ static const char *set_secure_listener(cmd_parms *cmd, void *dummy,
     if (!port) 
            return "Port must be numeric";
            
-    apr_table_set(sc->sltable, ports, addr);
+    apr_table_add(sc->sltable, ports, addr);
     
     new->local_addr.sin_port = htons(port);
     new->fd = -1;
@@ -681,20 +681,29 @@ static void *nwssl_config_server_merge(apr_pool_t *p, void *basev, void *addv)
     return merged;
 }
 
+static int compare_ipports(void *rec, const char *key, const char *value)
+{
+    conn_rec *c = (conn_rec*)rec;
+
+    if (value && 
+        ((strcmp(value, "0.0.0.0") == 0) || (strcmp(value, c->local_ip) == 0))) 
+    {
+        return 0;
+    }
+    return 1;
+}
+
 static int isSecureConnEx (const server_rec *s, const conn_rec *c, const apr_table_t *t)
 {
-    NWSSLSrvConfigRec *sc = get_nwssl_cfg(s);
-    const char *s_secure = NULL;
     char port[8];
-    int ret = 0;
 
     itoa((c->local_addr)->port, port, 10);
-    s_secure = apr_table_get(t, port); 
-    if (s_secure && 
-        ((strcmp(s_secure, "0.0.0.0") == 0) || (strcmp(s_secure, c->local_ip) == 0)))
-        ret = 1;
+    if (!apr_table_do(compare_ipports, (void*)c, t, port, NULL))
+    {
+        return 1;
+    }
 
-    return ret;
+    return 0;
 }
 
 static int isSecureConn (const server_rec *s, const conn_rec *c)