]> granicus.if.org Git - apache/commitdiff
Fix backward compatibility with APR versions less than 2.0 which don't have
authorBrian Havard <bjh@apache.org>
Tue, 13 Apr 2010 11:07:29 +0000 (11:07 +0000)
committerBrian Havard <bjh@apache.org>
Tue, 13 Apr 2010 11:07:29 +0000 (11:07 +0000)
apr_socket_wait().

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

modules/filters/mod_reqtimeout.c
modules/proxy/mod_proxy_fdpass.c

index cec9e607da5b27175ae8de48b97f47399d94309e..0dad52138c9d56c377d87cd09f1aadb4e099a010 100644 (file)
 #include "util_filter.h"
 #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;
 
@@ -218,7 +222,11 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f,
             }
 
             /* ... and wait for more */
+#if APR_MAJOR_VERSION < 2
+            rv = apr_wait_for_io_or_timeout(NULL, ccfg->socket, 1);
+#else
             rv = apr_socket_wait(ccfg->socket, APR_WAIT_READ);
+#endif
             if (rv != APR_SUCCESS)
                 break;
 
index bac014fcee251307f514a690c1f6a7dd14a8492a..542dfb3942131ad634f3d96f57b39663598f406d 100644 (file)
 #error This module only works on unix platforms with the correct OS support
 #endif
 
+#include "apr_version.h"
+#if APR_MAJOR_VERSION < 2
+/* for apr_wait_for_io_or_timeout */
+#include "apr_support.h"
+#endif
+
 #include "mod_proxy_fdpass.h"
 
 module AP_MODULE_DECLARE_DATA proxy_fdpass_module;
@@ -73,7 +79,12 @@ static apr_status_t socket_connect_un(apr_socket_t *sock,
 
     if ((rv == -1) && (errno == EINPROGRESS || errno == EALREADY)
         && (t > 0)) {
+#if APR_MAJOR_VERSION < 2
+        rv = apr_wait_for_io_or_timeout(NULL, sock, 0);
+#else
         rv = apr_socket_wait(sock, APR_WAIT_WRITE);
+#endif
+
         if (rv != APR_SUCCESS) {
             return rv;
         }