diff options
author | Wilfredo Sanchez <wsanchez@apache.org> | 2005-05-25 01:55:28 +0000 |
---|---|---|
committer | Wilfredo Sanchez <wsanchez@apache.org> | 2005-05-25 01:55:28 +0000 |
commit | a77ad010ebaa2f32251590833a4172dce84d9488 (patch) | |
tree | 5e23ab87ccc813d90b1fea372563d86a47b56ef2 | |
parent | 08f4747567fe71118bb85e78c6dfaa9394b5dbd8 (diff) | |
download | httpd-a77ad010ebaa2f32251590833a4172dce84d9488.tar.gz |
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
-rw-r--r-- | server/core_filters.c | 18 |
1 files 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 */ } } } |