]> granicus.if.org Git - apache/commitdiff
Commits 160348 and 160352 are obviated by commit 178340 in APR. httpd
authorWilfredo Sanchez <wsanchez@apache.org>
Wed, 25 May 2005 01:55:28 +0000 (01:55 +0000)
committerWilfredo Sanchez <wsanchez@apache.org>
Wed, 25 May 2005 01:55:28 +0000 (01:55 +0000)
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

index 44359d86fa6fdf0eca9cafabc0f906ccf3b21189..e17a1806c485794a3edcd6c14ae2e615057d392a 100644 (file)
@@ -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 */
             }
         }
     }