]> granicus.if.org Git - apache/commitdiff
Bring Apache in line with APR's new poll implementation. This isn't
authorRyan Bloom <rbb@apache.org>
Thu, 11 Jul 2002 05:42:20 +0000 (05:42 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 11 Jul 2002 05:42:20 +0000 (05:42 +0000)
optimal, because it still uses the compatibility functions to make it
work, but it does work.  The next step will be to take the memory for
the pollsets under Apache's control.

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

modules/experimental/mod_ext_filter.c
modules/proxy/proxy_connect.c
server/mpm/beos/beos.c
server/mpm/experimental/leader/leader.c
server/mpm/experimental/perchild/perchild.c
server/mpm/experimental/threadpool/threadpool.c
server/mpm/mpmt_os2/mpmt_os2_child.c
server/mpm/prefork/prefork.c
server/mpm/worker/worker.c
support/ab.c

index 97bb9bc87e87903c71996f705d5b1a6996f24eaa..37fa4137b1bfcf5d839e933ba5bc146dad1a1d2e 100644 (file)
@@ -71,6 +71,7 @@
 #include "apr_strings.h"
 #include "apr_hash.h"
 #include "apr_lib.h"
+#include "apr_poll.h"
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
 
@@ -627,9 +628,8 @@ static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data,
 #if APR_FILES_AS_SOCKETS
                 int num_events;
                 
-                rv = apr_poll(ctx->pollset,
-                              &num_events,
-                              f->r->server->timeout);
+                rv = apr_poll(ctx->pollset, 2,
+                              &num_events, f->r->server->timeout);
                 if (rv || dc->debug >= DBGLVL_GORY) {
                     ap_log_rerror(APLOG_MARK, APLOG_DEBUG,
                                   rv, f->r, "apr_poll()");
index 4a0b85266e51215ef5c8f0b57aaf01ab8a1a9a34..25423f00fba1d7c80b5671ced58777edf2c33627 100644 (file)
@@ -61,6 +61,7 @@
 #define CORE_PRIVATE
 
 #include "mod_proxy.h"
+#include "apr_poll.h"
 
 module AP_MODULE_DECLARE_DATA proxy_connect_module;
 
@@ -320,7 +321,7 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
 
     while (1) { /* Infinite loop until error (one side closes the connection) */
 /*     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: going to sleep (poll)");*/
-        if ((rv = apr_poll(pollfd, &pollcnt, -1)) != APR_SUCCESS)
+        if ((rv = apr_poll(pollfd, 2, &pollcnt, -1)) != APR_SUCCESS)
         {
            apr_socket_close(sock);
             ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: CONNECT: error apr_poll()");
index 3aaa1e3859dbd4c723561b9634fa3d2485af1a2b..e07a7f14baf182e9ff7e0e8c83a5c25cccc88df5 100644 (file)
@@ -87,6 +87,7 @@
 #include "mpm.h"
 #include "mpm_default.h"
 #include "apr_thread_mutex.h"
+#include "apr_poll.h"
 
 extern int _kset_fd_limit_(int num);
 
@@ -421,7 +422,7 @@ static int32 worker_thread(void * dummy)
             apr_int16_t event;
             apr_status_t ret;
 
-            ret = apr_poll(pollset, &srv, -1);
+            ret = apr_poll(pollset, num_listening_sockets, &srv, -1);
 
             if (ret != APR_SUCCESS) {
                 if (APR_STATUS_IS_EINTR(ret)) {
index 02d55a1204ca3e808f256f7af32eef6a72d83576..aefa44a1630e3597dbb79e5cedb1a86763c5dc7f 100644 (file)
 #include "ap_listen.h"
 #include "scoreboard.h" 
 #include "mpm_default.h"
+#include "apr_poll.h"
 
 #include <signal.h>
 #include <limits.h>             /* for INT_MAX */
@@ -888,7 +889,7 @@ static void *worker_thread(apr_thread_t *thd, void * dummy)
                 apr_status_t ret;
                 apr_int16_t event;
 
-                ret = apr_poll(pollset, &n, -1);
+                ret = apr_poll(pollset, num_listensocks, &n, -1);
                 if (ret != APR_SUCCESS) {
                     if (APR_STATUS_IS_EINTR(ret)) {
                         continue;
index 2d6dbf9ff5d2a90d1d036511166af14838ee2e5c..ce58400ee2d59c81a6dff4410a376210c1fca53e 100644 (file)
@@ -95,6 +95,7 @@
 #include "mpm.h"
 #include "scoreboard.h"
 #include "util_filter.h"
+#include "apr_poll.h"
 
 /* ### should be APR-ized */
 #include <poll.h>
@@ -748,7 +749,7 @@ static void *worker_thread(apr_thread_t *thd, void *arg)
 
         while (!workers_may_exit) {
             apr_int16_t event;
-            srv = apr_poll(pollset, &n, -1);
+            srv = apr_poll(pollset, num_listensocks, &n, -1);
 
             if (srv != APR_SUCCESS) {
                 if (APR_STATUS_IS_EINTR(srv)) {
index 79e18ec41425eeb3258ea14f88ac9bee52c94893..e1e11020584ff459ccbba6a4aea0a0c2d22d5219 100644 (file)
@@ -69,6 +69,7 @@
 #include "apr_file_io.h"
 #include "apr_thread_proc.h"
 #include "apr_signal.h"
+#include "apr_poll.h"
 #include "apr_thread_mutex.h"
 #include "apr_thread_cond.h"
 #include "apr_proc_mutex.h"
@@ -913,7 +914,7 @@ static void *listener_thread(apr_thread_t *thd, void * dummy)
                 apr_status_t ret;
                 apr_int16_t event;
 
-                ret = apr_poll(pollset, &n, -1);
+                ret = apr_poll(pollset, num_listensocks, &n, -1);
                 if (ret != APR_SUCCESS) {
                     if (APR_STATUS_IS_EINTR(ret)) {
                         continue;
index 8fa70163063f65e249f6be9e2f67fe716a9238e6..31a75265714703cc88114a7ff42f95a37bfe922b 100644 (file)
@@ -73,6 +73,7 @@
 #include "ap_mpm.h"
 #include "ap_listen.h"
 #include "apr_portable.h"
+#include "apr_poll.h"
 #include "mpm_common.h"
 #include "apr_strings.h"
 #include <os2.h>
@@ -250,7 +251,7 @@ void ap_mpm_child_main(apr_pool_t *pconf)
             rv = APR_FROM_OS_ERROR(rc);
 
             if (rv == APR_SUCCESS) {
-                rv = apr_poll(pollset, &nsds, -1);
+                rv = apr_poll(pollset, num_listeners, &nsds, -1);
                 DosReleaseMutexSem(ap_mpm_accept_mutex);
             }
 
index ec12fd8376807f67a33510df154a9cc7fb5251ba..9c9b7f6f0f1a2fe039c47277b3c4e662880cb6e4 100644 (file)
@@ -89,6 +89,7 @@
 #include "mpm_common.h"
 #include "ap_listen.h"
 #include "ap_mmn.h"
+#include "apr_poll.h"
 
 #ifdef HAVE_BSTRING_H
 #include <bstring.h>           /* for IRIX, FD_SET calls bzero() */
@@ -631,7 +632,7 @@ static void child_main(int child_num_arg)
                 apr_int16_t event;
                 apr_int32_t n;
 
-                ret = apr_poll(pollset, &n, -1);
+                ret = apr_poll(pollset, num_listensocks, &n, -1);
                 if (ret != APR_SUCCESS) {
                     if (APR_STATUS_IS_EINTR(ret)) {
                         continue;
index c9cec3f8539683b4da8f504508adceee4f8cacca..72d5ce7aaf48c23b56fb8d1919f684d75f72ff5c 100644 (file)
@@ -71,6 +71,7 @@
 #include "apr_signal.h"
 #include "apr_thread_mutex.h"
 #include "apr_proc_mutex.h"
+#include "apr_poll.h"
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
 
@@ -758,7 +759,7 @@ static void *listener_thread(apr_thread_t *thd, void * dummy)
                 apr_status_t ret;
                 apr_int16_t event;
 
-                ret = apr_poll(pollset, &n, -1);
+                ret = apr_poll(pollset, num_listensocks, &n, -1);
                 if (ret != APR_SUCCESS) {
                     if (APR_STATUS_IS_EINTR(ret)) {
                         continue;
index 9d603cef19e2a4dcc11c70b9a75da004c646549c..b70c6efa7b15cd417e5c53f5e41a2f02242f0d90 100644 (file)
 #include "apr_lib.h"
 #include "apr_portable.h"
 #include "ap_release.h"
+#include "apr_poll.h"
 
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
@@ -1648,7 +1649,7 @@ static void test(void)
             status = APR_SUCCESS;
         else
 #endif
-       status = apr_poll(readbits, &n, aprtimeout);
+       status = apr_poll(readbits, concurrency, &n, aprtimeout);
        if (status != APR_SUCCESS)
            apr_err("apr_poll", status);
 
@@ -1725,14 +1726,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.108 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.109 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
        printf("\n");
     }
     else {
        printf("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.108 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.109 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");