From: Ryan Bloom Date: Thu, 22 Jun 2000 19:46:23 +0000 (+0000) Subject: Commit a few changes to the mpmt_pthread and dexter MPMs. These basically X-Git-Tag: APACHE_2_0_ALPHA_5~263 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fc0d745579064ae5181edbe04822abb2de73c90;p=apache Commit a few changes to the mpmt_pthread and dexter MPMs. These basically 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 --- diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index df4f142595..500c515b83 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -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; diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index e86c3c357a..5fe9a37f1e 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -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;