From 5765ad4ecf1dbbf9a292413dcfdb0bf9c1c50084 Mon Sep 17 00:00:00 2001 From: wrowe Date: Thu, 1 May 2008 22:25:11 +0000 Subject: 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 --- network_io/unix/sendrecv.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'network_io/unix/sendrecv.c') 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)); -- cgit v1.2.1