summaryrefslogtreecommitdiff
path: root/network_io/unix/sendrecv.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-05-01 22:25:11 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-05-01 22:25:11 +0000
commit5765ad4ecf1dbbf9a292413dcfdb0bf9c1c50084 (patch)
tree87adf842708941fc9cb97503ecd5dd44c2c6d385 /network_io/unix/sendrecv.c
parentf1262abe3cd6159cfb22c4ca25036d7cab93e8ae (diff)
downloadlibapr-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.c10
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));