You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2009/11/09 13:48:25 UTC

svn commit: r834040 - in /apr/apr/trunk/poll/unix: pollcb.c pollset.c

Author: trawick
Date: Mon Nov  9 12:48:25 2009
New Revision: 834040

URL: http://svn.apache.org/viewvc?rev=834040&view=rev
Log:
fix special poll() processing on Win32 to be consistent
between
. apr_{pollset|pollcb}_create_ex(..., APR_POLLSET_DEFAULT)
and
. apr_{pollset|pollcb}_create(...)

Modified:
    apr/apr/trunk/poll/unix/pollcb.c
    apr/apr/trunk/poll/unix/pollset.c

Modified: apr/apr/trunk/poll/unix/pollcb.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollcb.c?rev=834040&r1=834039&r2=834040&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollcb.c (original)
+++ apr/apr/trunk/poll/unix/pollcb.c Mon Nov  9 12:48:25 2009
@@ -84,6 +84,17 @@
 
     *ret_pollcb = NULL;
 
+ #ifdef WIN32
+    /* This will work only if ws2_32.dll has WSAPoll funtion.
+     * We could check the presence of the function here,
+     * but someone might implement other pollcb method in
+     * the future.
+     */
+    if (method == APR_POLLSET_DEFAULT) {
+        method = APR_POLLSET_POLL;
+    }
+ #endif
+
     if (method == APR_POLLSET_DEFAULT)
         method = pollset_default_method;
     while (provider == NULL) {
@@ -135,14 +146,6 @@
                                             apr_uint32_t flags)
 {
     apr_pollset_method_e method = APR_POLLSET_DEFAULT;
- #ifdef WIN32
-    /* This will work only if ws2_32.dll has WSAPoll funtion.
-     * We could check the presence of the function here,
-     * but someone might implement other pollcb method in
-     * the future.
-     */
-    method = APR_POLLSET_POLL;
- #endif
     return apr_pollcb_create_ex(pollcb, size, p, flags, method);
 }
 

Modified: apr/apr/trunk/poll/unix/pollset.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollset.c?rev=834040&r1=834039&r2=834040&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollset.c (original)
+++ apr/apr/trunk/poll/unix/pollset.c Mon Nov  9 12:48:25 2009
@@ -222,6 +222,17 @@
 
     *ret_pollset = NULL;
 
+ #ifdef WIN32
+    /* Favor WSAPoll if supported.
+     * This will work only if ws2_32.dll has WSAPoll funtion.
+     * In other cases it will fall back to select() method unless
+     * the APR_POLLSET_NODEFAULT is added to the flags.
+     */
+    if (method == APR_POLLSET_DEFAULT) {
+        method = APR_POLLSET_POLL;
+    }
+ #endif
+
     if (method == APR_POLLSET_DEFAULT)
         method = pollset_default_method;
     while (provider == NULL) {
@@ -297,14 +308,6 @@
                                              apr_uint32_t flags)
 {
     apr_pollset_method_e method = APR_POLLSET_DEFAULT;
- #ifdef WIN32
-    /* Favor WSAPoll if supported.
-     * This will work only if ws2_32.dll has WSAPoll funtion.
-     * In other cases it will fall back to select() method unless
-     * the APR_POLLSET_NODEFAULT is added to the flags.
-     */
-    method = APR_POLLSET_POLL;
- #endif
     return apr_pollset_create_ex(pollset, size, p, flags, method);
 }