From eb57e6cbea33e0a7cef4cfa6f1f52772779f947d Mon Sep 17 00:00:00 2001 From: trawick Date: Sat, 14 Nov 2009 03:06:45 +0000 Subject: merge r834040 from trunk: fix special poll() processing on Win32 to be consistent between . apr_{pollset|pollcb}_create_ex(..., APR_POLLSET_DEFAULT) and . apr_{pollset|pollcb}_create(...) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@836107 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 19 +++++++++++-------- poll/unix/pollset.c | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 0af3e512c..2971b0216 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -84,6 +84,17 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, *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_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, 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); } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 049509f40..5ad70c994 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -222,6 +222,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, *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_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, 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); } -- cgit v1.2.1