]> granicus.if.org Git - apache/commitdiff
Get the prefork MPM using the apr_poll interface directly instead of going
authorRyan Bloom <rbb@apache.org>
Wed, 17 Jul 2002 18:42:54 +0000 (18:42 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 17 Jul 2002 18:42:54 +0000 (18:42 +0000)
through the old functions which are only still available for backwards
compat.

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

server/mpm/prefork/prefork.c

index 9c9b7f6f0f1a2fe039c47277b3c4e662880cb6e4..fab9a386083dd349e4beec3ebc90ceb0ba751ee4 100644 (file)
@@ -593,9 +593,13 @@ static void child_main(int child_num_arg)
         listensocks[i].sd = lr->sd;
     }
 
-    apr_poll_setup(&pollset, num_listensocks, pchild);
-    for (i = 0; i < num_listensocks; i++)
-        apr_poll_socket_add(pollset, listensocks[i].sd, APR_POLLIN);
+    pollset = apr_palloc(pchild, sizeof(*pollset) * num_listensocks);
+    pollset[0].p = pchild;
+    for (i = 0; i < num_listensocks; i++) {
+        pollset[i].desc.s = listensocks[i].sd;
+        pollset[i].desc_type = APR_POLL_SOCKET;
+        pollset[i].reqevents = APR_POLLIN;
+    }
 
     bucket_alloc = apr_bucket_alloc_create(pchild);
 
@@ -655,8 +659,7 @@ static void child_main(int child_num_arg)
                         curr_pollfd = 0;
                     }
                     /* XXX: Should we check for POLLERR? */
-                    apr_poll_revents_get(&event, listensocks[curr_pollfd].sd, pollset);
-                    if (event & APR_POLLIN) {
+                    if (pollset[curr_pollfd].rtnevents & APR_POLLIN) {
                         last_pollfd = curr_pollfd;
                         offset = curr_pollfd;
                         goto got_fd;