From a77ad010ebaa2f32251590833a4172dce84d9488 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 25 May 2005 01:55:28 +0000 Subject: [PATCH] Commits 160348 and 160352 are obviated by commit 178340 in APR. httpd should have to deal with EAGAIN on a socket it doesn't know is non-blocking. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@178341 13f79535-47bb-0310-9956-ffa450edef68 --- server/core_filters.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/server/core_filters.c b/server/core_filters.c index 44359d86fa..e17a1806c4 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -522,16 +522,14 @@ static apr_status_t emulate_sendfile(core_net_rec *c, apr_file_t *fd, sendlen = togo > sizeof(buffer) ? sizeof(buffer) : togo; o = 0; rv = apr_file_read(fd, buffer, &sendlen); - if (rv == APR_SUCCESS && sendlen) { - while ((rv == APR_SUCCESS || APR_STATUS_IS_EAGAIN(rv)) && sendlen) { - bytes_sent = sendlen; - rv = apr_socket_send(c->client_socket, &buffer[o], &bytes_sent); - *nbytes += bytes_sent; - if (rv == APR_SUCCESS) { - sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */ - o += bytes_sent; /* o is where we are in the buffer */ - togo -= bytes_sent; /* track how much of the file we've sent */ - } + while (rv == APR_SUCCESS && sendlen) { + bytes_sent = sendlen; + rv = apr_socket_send(c->client_socket, &buffer[o], &bytes_sent); + *nbytes += bytes_sent; + if (rv == APR_SUCCESS) { + sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */ + o += bytes_sent; /* o is where we are in the buffer */ + togo -= bytes_sent; /* track how much of the file we've sent */ } } } -- 2.50.1