]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Exit when we can't listen on any of the configured ports. This
authorJeff Trawick <trawick@apache.org>
Tue, 16 Oct 2001 18:45:16 +0000 (18:45 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 16 Oct 2001 18:45:16 +0000 (18:45 +0000)
is the same behavior as 1.3, and it avoids having the MPMs to
deal with bogus ap_listen_rec structures.

This also backs out some circumventions I and Greg Ames had added
to prefork; these are no longer necessary because of this change.

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

CHANGES
server/listen.c
server/mpm/prefork/prefork.c

diff --git a/CHANGES b/CHANGES
index 0872d99ffb7849021e43d8826368763dbca2742a..35a447f18bc2ae6c9e8e72c7ee99eacc86c04622 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.27-dev
 
+  *) Exit when we can't listen on any of the configured ports.  This
+     is the same behavior as 1.3, and it avoids having the MPMs to
+     deal with bogus ap_listen_rec structures.  [Jeff Trawick]
+
   *) Cleanup the proxy code that creates a request to the origin
      server.  This change adds an optional hook, which allows modules
      to gain control while the request is created if the proxy module
index 8068dce659e362fb1d7a1c1a3a8a42d51d16643e..6a6e919a7fa42aed1fecebe92841b38480821b44 100644 (file)
@@ -287,6 +287,10 @@ int ap_listen_open(process_rec *process, apr_port_t port)
                ++num_open;
                lr->active = 1;
            }
+            else {
+                /* fatal error */
+                return -1;
+            }
        }
     }
 
index b2903441f31aff1b4f8fef2c40cc6ea28b89baed..e19c7968de0a0385aa46657e576b9366a8be5744 100644 (file)
@@ -663,14 +663,12 @@ static void child_main(int child_num_arg)
                }
                first_lr=lr;
                do {
-                    if (lr->active) {
-                        apr_os_sock_get(&sockdes, lr->sd);
-                       if (FD_ISSET(sockdes, &main_fds))
-                           goto got_listener;
-                        lr = lr->next;
-                        if (!lr)
-                            lr = ap_listeners;
-                    }
+                    apr_os_sock_get(&sockdes, lr->sd);
+                    if (FD_ISSET(sockdes, &main_fds))
+                        goto got_listener;
+                    lr = lr->next;
+                    if (!lr)
+                        lr = ap_listeners;
                }
                while (lr != first_lr);
                /* FIXME: if we get here, something bad has happened, and we're
@@ -1090,12 +1088,10 @@ static int setup_listeners(server_rec *s)
     listenmaxfd = -1;
     FD_ZERO(&listenfds);
     for (lr = ap_listeners; lr; lr = lr->next) {
-        if (lr->active) {
-            apr_os_sock_get(&sockdes, lr->sd);
-            FD_SET(sockdes, &listenfds);
-            if (sockdes > listenmaxfd) {
-                listenmaxfd = sockdes;
-            }
+        apr_os_sock_get(&sockdes, lr->sd);
+        FD_SET(sockdes, &listenfds);
+        if (sockdes > listenmaxfd) {
+            listenmaxfd = sockdes;
         }
     }
     return 0;