From: Jeff Trawick Date: Wed, 10 Oct 2001 15:12:12 +0000 (+0000) Subject: prefork: Don't segfault when we are able to listen on some but X-Git-Tag: 2.0.26~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f78b345b2b683db69f5a15b0c501b0d29e1dfcb;p=apache prefork: Don't segfault when we are able to listen on some but 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 --- diff --git a/CHANGES b/CHANGES index 20e0fc3334..cdb9904dc4 100644 --- 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 ] diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index fe98d51f82..186619c58e 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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; }