httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r935339 - /httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
Date Sun, 18 Apr 2010 13:34:37 GMT
Author: sf
Date: Sun Apr 18 13:34:37 2010
New Revision: 935339

URL: http://svn.apache.org/viewvc?rev=935339&view=rev
Log:
Replace apr_wait_for_io_or_timeout with apr_poll, to (hopefully) allow
mod_reqtimeout to work under windows with apr 1.x

Modified:
    httpd/httpd/trunk/modules/filters/mod_reqtimeout.c

Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=935339&r1=935338&r2=935339&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Sun Apr 18 13:34:37 2010
@@ -25,9 +25,6 @@
 #define APR_WANT_STRFUNC
 #include "apr_strings.h"
 #include "apr_version.h"
-#if APR_MAJOR_VERSION < 2
-#include "apr_support.h"
-#endif
 
 module AP_MODULE_DECLARE_DATA reqtimeout_module;
 
@@ -186,6 +183,11 @@ static apr_status_t reqtimeout_filter(ap
         apr_off_t remaining = HUGE_STRING_LEN;
         do {
             apr_off_t bblen;
+#if APR_MAJOR_VERSION < 2
+            apr_int32_t nsds;
+            apr_interval_time_t poll_timeout;
+            apr_pollfd_t pollset;
+#endif
 
             rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE, APR_NONBLOCK_READ, remaining);
             if (APR_STATUS_IS_EAGAIN(rv)) {
@@ -223,7 +225,12 @@ static apr_status_t reqtimeout_filter(ap
 
             /* ... and wait for more */
 #if APR_MAJOR_VERSION < 2
-            rv = apr_wait_for_io_or_timeout(NULL, ccfg->socket, 1);
+            pollset.p = f->c->pool;
+            pollset.desc_type = APR_POLL_SOCKET;
+            pollset.reqevents = APR_POLLIN|APR_POLLHUP;
+            pollset.desc.s = ccfg->socket;
+            apr_socket_timeout_get(ccfg->socket, &poll_timeout);
+            rv = apr_poll(&pollset, 1, &nsds, poll_timeout);
 #else
             rv = apr_socket_wait(ccfg->socket, APR_WAIT_READ);
 #endif



Mime
View raw message