]> granicus.if.org Git - apache/commitdiff
Don't allow initialization to succeed if we can't get a socket
authorJeff Trawick <trawick@apache.org>
Mon, 1 Apr 2002 12:53:09 +0000 (12:53 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 1 Apr 2002 12:53:09 +0000 (12:53 +0000)
corresponding to one of the Listen statements.

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

CHANGES
server/listen.c

diff --git a/CHANGES b/CHANGES
index c23af1e7dd5624c54943ea3111a2c407f46059c5..7fd5937a27d7c1556d37a53b384b0fe9e1be33b7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Changes with Apache 2.0.35
+
+  *) Don't allow initialization to succeed if we can't get a socket
+     corresponding to one of the Listen statements.  [Jeff Trawick]
+
 Changes with Apache 2.0.34
 
   *) Allow all Perchild directives to accept either numerical UID/GID
index 8e0a539dd4ee7ec0e1bb85bab03b2e391a254b21..7f0c32c048cf0317489f3d56786d2c582577cede 100644 (file)
@@ -238,7 +238,7 @@ static void find_default_family(apr_pool_t *p)
 }
 
 
-static void alloc_listener(process_rec *process, char *addr, apr_port_t port)
+static const char *alloc_listener(process_rec *process, char *addr, apr_port_t port)
 {
     ap_listen_rec **walk;
     ap_listen_rec *new;
@@ -278,7 +278,7 @@ static void alloc_listener(process_rec *process, char *addr, apr_port_t port)
                 *walk = new->next;
                 new->next = ap_listeners;
                 ap_listeners = new;
-                return;
+                return NULL;
             }
         }
     }
@@ -292,7 +292,7 @@ static void alloc_listener(process_rec *process, char *addr, apr_port_t port)
         ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool,
                       "alloc_listener: failed to set up sockaddr for %s",
                       addr);
-        return;
+        return "Listen setup failed";
     }
     if ((status = apr_socket_create(&new->sd,
                                     new->bind_addr->family,
@@ -300,11 +300,12 @@ static void alloc_listener(process_rec *process, char *addr, apr_port_t port)
         != APR_SUCCESS) {
         ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool,
                       "alloc_listener: failed to get a socket for %s", addr);
-        return;
+        return "Listen setup failed";
     }
 
     new->next = ap_listeners;
     ap_listeners = new;
+    return NULL;
 }
 
 static int ap_listen_open(apr_pool_t *pool, apr_port_t port)
@@ -401,9 +402,7 @@ const char *ap_set_listener(cmd_parms *cmd, void *dummy, const char *ips)
         return "Port must be specified";
     }
 
-    alloc_listener(cmd->server->process, host, port);
-
-    return NULL;
+    return alloc_listener(cmd->server->process, host, port);
 }
 
 const char *ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg)