diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2003-11-17 01:41:18 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2003-11-17 01:41:18 +0000 |
commit | 4825d7e302a225991dec3d211c9ff42ba90b5039 (patch) | |
tree | 3a246b886518c4c5ac54eb4381929d7cd4d6659f /network_io/os2 | |
parent | 5703b123e764ea25f6c02096bca7ad701126c22d (diff) | |
download | libapr-4825d7e302a225991dec3d211c9ff42ba90b5039.tar.gz |
With the removal of apr_poll(), the apr_wait_for_io_or_timeout() function
needed to be rebuilt. Specifically, it needs a pollset, but we don't want
to allocate that all the time. Thus, we need to create it once at socket
or file creation time, and then reuse that pollset.
NOTE: this makes the library compile, but some of the test programs may
not. I have also not verified this work yet (in favor of just getting it
to at least compile...)
For the apr_arch_*.h files, I added a pollset member to the file and
socket structures.
For the various open/dup/etc functions, I added the creation of that
pollset whenever a file or socket is created.
(I may have missed some and will verify further)
For the socket create and sendrecv function, I added the creation of the
pollset.
(again, may have missed some, but if everybody uses alloc_socket, then we
should be okay)
* support/unix/waitio.c: rebuild in terms of the pollset
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64759 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/os2')
-rw-r--r-- | network_io/os2/sockets.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5c13fe39f..66949b573 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -103,6 +103,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); } APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol) @@ -115,6 +119,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int int protocol, apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); + apr_pollfd_t pfd; if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -143,6 +148,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int (*new)->nonblock = FALSE; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; } |