]> granicus.if.org Git - apache/commitdiff
prefork: Don't segfault when we are able to listen on some but
authorJeff Trawick <trawick@apache.org>
Wed, 10 Oct 2001 15:12:12 +0000 (15:12 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 10 Oct 2001 15:12:12 +0000 (15:12 +0000)
not all of the configured ports.

Other points to ponder:

  why no log message for the segfault?

  similar change would seem to be needed in other MPMs...  we
  may be adding bogus entries to the poll set

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

CHANGES
server/mpm/prefork/prefork.c

diff --git a/CHANGES b/CHANGES
index 20e0fc333482c80e2c7e67cd50d4d9ed1c249e19..cdb9904dc415a805848e757ca2cab0f36c1ff003 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.26-dev
 
+  *) prefork: Don't segfault when we are able to listen on some but
+     not all of the configured ports.  [Jeff Trawick]
+
   *) Build mod_so even if no core modules are built shared.
      [Aaron Bannert <aaron@clove.org>]
 
index fe98d51f82919bbdf6f2b29e27470fa8cb1f5cfd..186619c58ee64913ffb5b90b6e8e36f3384729d9 100644 (file)
@@ -1088,11 +1088,13 @@ static int setup_listeners(server_rec *s)
     listenmaxfd = -1;
     FD_ZERO(&listenfds);
     for (lr = ap_listeners; lr; lr = lr->next) {
-        apr_os_sock_get(&sockdes, lr->sd);
-       FD_SET(sockdes, &listenfds);
-       if (sockdes > listenmaxfd) {
-           listenmaxfd = sockdes;
-       }
+        if (lr->active) {
+            apr_os_sock_get(&sockdes, lr->sd);
+            FD_SET(sockdes, &listenfds);
+            if (sockdes > listenmaxfd) {
+                listenmaxfd = sockdes;
+            }
+        }
     }
     return 0;
 }