diff options
author | Ivan Zhakov <ivan@apache.org> | 2019-05-27 19:49:41 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2019-05-27 19:49:41 +0000 |
commit | eddb49fadba339cf57c910f82090a2f0c3205234 (patch) | |
tree | 0a5e4e9dc2e2c5b8cb4dfbb9225338ca6a9d18c7 | |
parent | 7f2843c553ac9c73c34bdfe0f0f788096cba1afe (diff) | |
download | apr-eddb49fadba339cf57c910f82090a2f0c3205234.tar.gz |
Windows platform: Use WSAPoll directly.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860159 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/arch/win32/apr_arch_misc.h | 32 | ||||
-rw-r--r-- | poll/unix/poll.c | 11 | ||||
-rw-r--r-- | poll/unix/pollset.c | 6 |
3 files changed, 2 insertions, 47 deletions
diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 4fbe79ff4..0f25b7995 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -303,38 +303,6 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0, ( (hSnapshot, lppe)); #define Process32NextW apr_winapi_Process32NextW -#if !defined(POLLERR) -/* Event flag definitions for WSAPoll(). */ -#define POLLRDNORM 0x0100 -#define POLLRDBAND 0x0200 -#define POLLIN (POLLRDNORM | POLLRDBAND) -#define POLLPRI 0x0400 - -#define POLLWRNORM 0x0010 -#define POLLOUT (POLLWRNORM) -#define POLLWRBAND 0x0020 - -#define POLLERR 0x0001 -#define POLLHUP 0x0002 -#define POLLNVAL 0x0004 - -typedef struct pollfd { - SOCKET fd; - SHORT events; - SHORT revents; - -} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; - -#endif /* !defined(POLLERR) */ -#ifdef WSAPoll -#undef WSAPoll -#endif -APR_DECLARE_LATE_DLL_FUNC(DLL_WINSOCK2API, int, WSAAPI, WSAPoll, 0, ( - IN OUT LPWSAPOLLFD fdArray, - IN ULONG fds, - IN INT timeout), - (fdArray, fds, timeout)); -#define WSAPoll apr_winapi_WSAPoll #define HAVE_POLL 1 #ifdef if_nametoindex diff --git a/poll/unix/poll.c b/poll/unix/poll.c index f148f5e50..e96a53cff 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -162,11 +162,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, if (flags & APR_POLLSET_THREADSAFE) { return APR_ENOTIMPL; } -#ifdef WIN32 - if (!APR_HAVE_LATE_DLL_FUNC(WSAPoll)) { - return APR_ENOTIMPL; - } -#endif + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); pollset->p->pollset = apr_palloc(p, size * sizeof(struct pollfd)); pollset->p->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -322,11 +318,6 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, return APR_ENOTIMPL; #else pollcb->fd = -1; -#ifdef WIN32 - if (!APR_HAVE_LATE_DLL_FUNC(WSAPoll)) { - return APR_ENOTIMPL; - } -#endif pollcb->pollset.ps = apr_palloc(p, size * sizeof(struct pollfd)); pollcb->copyset = apr_palloc(p, size * sizeof(apr_pollfd_t *)); diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 8fa817330..13c939371 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -111,11 +111,7 @@ 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. - */ + /* Favor WSAPoll. */ if (method == APR_POLLSET_DEFAULT) { method = APR_POLLSET_POLL; } |