]> granicus.if.org Git - apache/commitdiff
reverse the setup_listeners() change from a few days ago. it broke prefork
authorGreg Stein <gstein@apache.org>
Thu, 13 Jul 2000 09:17:46 +0000 (09:17 +0000)
committerGreg Stein <gstein@apache.org>
Thu, 13 Jul 2000 09:17:46 +0000 (09:17 +0000)
    by not getting listenmaxfd set, nor listenfds.

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

server/mpm/prefork/prefork.c

index 0b5a540c4d4fbc2ffd90e4241a959f8637245284..fa5166e425b13afea53b473a93f73c53099d0ad9 100644 (file)
@@ -1257,6 +1257,29 @@ static void perform_idle_server_maintenance(void)
     }
 }
 
+static int setup_listeners(server_rec *s)
+{
+    ap_listen_rec *lr;
+    int sockdes;
+
+    if (ap_listen_open(s->process, s->port)) {
+       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
+                   "no listening sockets available, shutting down");
+       return -1;
+    }
+
+    listenmaxfd = -1;
+    FD_ZERO(&listenfds);
+    for (lr = ap_listeners; lr; lr = lr->next) {
+        ap_get_os_sock(&sockdes, lr->sd);
+       FD_SET(sockdes, &listenfds);
+       if (sockdes > listenmaxfd) {
+           listenmaxfd = sockdes;
+       }
+    }
+    return 0;
+}
+
 /* Useful to erase the status of children that might be from previous
  * generations */
 static void ap_prefork_force_reset_connection_status(long conn_id)
@@ -1288,7 +1311,7 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
  
     ap_log_pid(pconf, ap_pid_fname);
 
-    if (ap_setup_listeners(s)) {
+    if (setup_listeners(s)) {
        /* XXX: hey, what's the right way for the mpm to indicate a fatal error? */
        return 1;
     }