diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-01 22:24:48 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-01 22:24:48 +0000 |
commit | 7e9cc1ecdb6620c01cfa2648bd5646214f720266 (patch) | |
tree | 61fc6485bd0d83bf17f0363e0add3fe069a9b117 | |
parent | a985b87f5de8dc607edc619ac4e2b1193af094ca (diff) | |
download | libapr-7e9cc1ecdb6620c01cfa2648bd5646214f720266.tar.gz |
Optimize away a second poll by simply looping on the existing poll
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@652692 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | network_io/unix/sendrecv.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 39dd199e7..2362b215e 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -507,13 +507,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, rv = 0; } } - if ((rv == -1) && (errno == EAGAIN) - && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + + if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { + sock->options |= APR_INCOMPLETE_WRITE; } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); |