]> granicus.if.org Git - apache/commitdiff
Commit a few changes to the mpmt_pthread and dexter MPMs. These basically
authorRyan Bloom <rbb@apache.org>
Thu, 22 Jun 2000 19:46:23 +0000 (19:46 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 22 Jun 2000 19:46:23 +0000 (19:46 +0000)
fix the error checking for one return from ap_poll, and use ap_pcalloc to
allocate the listenfds array.  By using listenfds, we can avoid making
an unnecessary call to ap_create_tcp_socket.
Submitted by: Jeff Trawick
Reviewed by: Ryan Bloom

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

server/mpm/dexter/dexter.c
server/mpm/mpmt_pthread/mpmt_pthread.c

index df4f1425954bfe155f40fbb8ae166edd42247b99..500c515b83c64feb74ae4e8fba2592878d89a648 100644 (file)
@@ -649,7 +649,7 @@ static void *worker_thread(void *arg)
             srv = ap_poll(pollset, &n, -1);
 
             if (srv != APR_SUCCESS) {
-                if (errno == APR_EINTR) {
+                if (ap_canonical_error(srv) == APR_EINTR) {
                     continue;
                 }
 
@@ -796,7 +796,7 @@ static void child_main(int child_num_arg)
     requests_this_child = max_requests_per_child;
     
     /* Set up the pollfd array */
-    listenfds = ap_palloc(pchild, sizeof(*listenfds) * (num_listenfds + 1));
+    listenfds = ap_pcalloc(pchild, sizeof(*listenfds) * (num_listenfds + 1));
     ap_put_os_sock(&listenfds[0], &pipe_of_death[0], pchild);
     for (lr = ap_listeners, i = 1; i <= num_listenfds; lr = lr->next, ++i)
         listenfds[i]=lr->sd;
index e86c3c357abfd95e4b40a5f10533eb9a36c2e595..5fe9a37f1e396e9adcb6ce142bdd2aa728323374 100644 (file)
@@ -596,7 +596,7 @@ static void * worker_thread(void * dummy)
 
             ret = ap_poll(pollset, &n, -1);
             if (ret != APR_SUCCESS) {
-                if (ret == APR_EINTR) {
+                if (ap_canonical_error(ret) == APR_EINTR) {
                     continue;
                 }
 
@@ -734,9 +734,8 @@ static void child_main(int child_num_arg)
     requests_this_child = ap_max_requests_per_child;
     
     /* Set up the pollfd array */
-    listensocks = ap_palloc(pchild,
+    listensocks = ap_pcalloc(pchild,
                            sizeof(*listensocks) * (num_listensocks + 1));
-    ap_create_tcp_socket(&listensocks[0], pchild);
     ap_put_os_sock(&listensocks[0], &pipe_of_death[0], pchild);
     for (lr = ap_listeners, i = 1; i <= num_listensocks; lr = lr->next, ++i)
        listensocks[i]=lr->sd;