diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-01 22:25:11 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-01 22:25:11 +0000 |
commit | 5765ad4ecf1dbbf9a292413dcfdb0bf9c1c50084 (patch) | |
tree | 87adf842708941fc9cb97503ecd5dd44c2c6d385 /network_io/unix/sendrecv.c | |
parent | f1262abe3cd6159cfb22c4ca25036d7cab93e8ae (diff) | |
download | libapr-5765ad4ecf1dbbf9a292413dcfdb0bf9c1c50084.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/branches/1.3.x@652693 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/unix/sendrecv.c')
-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)); |