]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Make the spmt_os2 MPM use the new setup_listeners API. This should work,
authorRyan Bloom <rbb@apache.org>
Mon, 10 Jul 2000 23:12:10 +0000 (23:12 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 10 Jul 2000 23:12:10 +0000 (23:12 +0000)
but I make no garauntees.

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

server/mpm/spmt_os2/spmt_os2.c

index 7425b3ca06399aba6800a9fb144f73c807d8c724..65650e3b9ad05d3d96e8f7c244079391ffa7edba 100644 (file)
@@ -727,6 +727,7 @@ static void child_main(void *child_num_arg)
     ap_pollfd_t *listen_poll;
     ap_socket_t *csd = NULL;
     int nsds, rv;
+    int num_listensocks;
 
     /* Disable the restart signal handlers and enable the just_die stuff.
      * Note that since restart() just notes that a restart has been
@@ -748,8 +749,15 @@ static void child_main(void *child_num_arg)
     THREAD_GLOBAL(pchild) = pchild;
     ap_create_pool(&ptrans, pchild);
 
-    if (ap_setup_listeners(pchild, &listen_poll)) {
-       clean_child_exit(1);
+    if ((num_listensocks = ap_setup_listeners(s)) < 1) {
+       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
+                   "no listening sockets available, shutting down");
+       return -1;
+    }
+
+    ap_setup_poll(&listen_poll, num_listensocks+1, pchild);
+    for (lr = ap_listeners; lr; lr = lr->next) {
+        ap_add_poll_socket(*listen_poll, lr->sd, APR_POLLIN);
     }
 
     /* needs to be done before we switch UIDs so we have permissions */
@@ -1167,12 +1175,6 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
     server_conf = s;
     ap_log_pid(pconf, ap_pid_fname);
 
-    if ((status = ap_listen_open(s->process, s->port)) != APR_SUCCESS) {
-       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, status, s,
-                   "no listening sockets available, shutting down");
-       return -1;
-    }
-
     SAFE_ACCEPT(accept_mutex_init(pconf));
 
     if (!is_graceful) {