You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2008/04/25 19:03:58 UTC

svn commit: r651651 - /apr/apr/trunk/network_io/unix/sendrecv.c

Author: wrowe
Date: Fri Apr 25 10:03:56 2008
New Revision: 651651

URL: http://svn.apache.org/viewvc?rev=651651&view=rev
Log:
Correct legacy crumbs from the new OS/X sendfile changes.

Submitted by: Geoff Greer <angryparsley mipsisrisc.com>]

Modified:
    apr/apr/trunk/network_io/unix/sendrecv.c

Modified: apr/apr/trunk/network_io/unix/sendrecv.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sendrecv.c?rev=651651&r1=651650&r2=651651&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sendrecv.c (original)
+++ apr/apr/trunk/network_io/unix/sendrecv.c Fri Apr 25 10:03:56 2008
@@ -410,7 +410,7 @@
                                  apr_hdtr_t * hdtr, apr_off_t * offset,
                                  apr_size_t * len, apr_int32_t flags)
 {
-    apr_off_t nbytes = *len;
+    apr_off_t nbytes = 0;
     apr_off_t bytes_to_send = *len;
     apr_size_t header_bytes_written = 0;
     int rv;
@@ -445,9 +445,6 @@
                 header_bytes_written = rv;
                 rv = 0;
             }
-            else {
-                header_bytes_written = 0;
-            }
         }
         else if (bytes_to_send) {
             /* We won't dare call sendfile() if we don't have
@@ -513,7 +510,7 @@
         }
     } while (rv == -1 && (errno == EINTR || errno == EAGAIN));
 
-    (*len) = nbytes;
+    (*len) = nbytes + header_bytes_written;
     if (rv == -1) {
         return errno;
     }