]> granicus.if.org Git - apache/commitdiff
Remove the hack from r806010 that mis-uses the pointer to the per-directory
authorStefan Fritsch <sf@apache.org>
Sat, 24 Mar 2012 18:01:07 +0000 (18:01 +0000)
committerStefan Fritsch <sf@apache.org>
Sat, 24 Mar 2012 18:01:07 +0000 (18:01 +0000)
config for other things. This breaks with MPMs that do have a per-directory
config.

If any module appears that wants to use this functionality, we can
add a new, non-broken API. Since the docs clearly state that ap_set_listener()
should not be called by external modules, I don't consider this an API/ABI
change, but only a bug fix.

PR: 52904

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1304874 13f79535-47bb-0310-9956-ffa450edef68

server/listen.c

index a4935aaac1e3311d8587f24c0708525a0fe02c59..a85095d45629cf55c38c6057d1b9f200084d359c 100644 (file)
@@ -238,7 +238,7 @@ static apr_status_t close_listeners_on_exec(void *v)
 
 static const char *alloc_listener(process_rec *process, char *addr,
                                   apr_port_t port, const char* proto,
-                                  void *dummy)
+                                  void *slave)
 {
     ap_listen_rec **walk, *last;
     apr_status_t status;
@@ -273,7 +273,7 @@ static const char *alloc_listener(process_rec *process, char *addr,
     }
 
     if (found_listener) {
-        if (ap_listeners->slave != dummy) {
+        if (ap_listeners->slave != slave) {
             return "Cannot define a slave on the same IP:port as a Listener";
         }
         return NULL;
@@ -333,7 +333,7 @@ static const char *alloc_listener(process_rec *process, char *addr,
             last->next = new;
             last = new;
         }
-        new->slave = dummy;
+        new->slave = slave;
     }
 
     return NULL;
@@ -612,10 +612,6 @@ AP_DECLARE(void) ap_listen_pre_config(void)
     ap_listenbacklog = DEFAULT_LISTENBACKLOG;
 }
 
-/* Hack: populate an extra field
- * When this gets called from a Listen directive, dummy is null.
- * So we can use non-null dummy to pass a data pointer without conflict
- */
 AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
                                                 int argc, char *const argv[])
 {
@@ -662,7 +658,7 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
         ap_str_tolower(proto);
     }
 
-    return alloc_listener(cmd->server->process, host, port, proto, dummy);
+    return alloc_listener(cmd->server->process, host, port, proto, NULL);
 }
 
 AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd,