diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2008-04-25 17:03:56 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2008-04-25 17:03:56 +0000 |
commit | ca1ce025304928c11f5b568ec63ebfe52b4e14b3 (patch) | |
tree | 63f723d985b3973bb7d99efc9098edc12012b1e7 | |
parent | 70e7809f255688de318aa51dc2a7a68c6aafa7a1 (diff) | |
download | apr-ca1ce025304928c11f5b568ec63ebfe52b4e14b3.tar.gz |
Correct legacy crumbs from the new OS/X sendfile changes.
Submitted by: Geoff Greer <angryparsley mipsisrisc.com>]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651651 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | network_io/unix/sendrecv.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 89e5ea749..3b43508c2 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -410,7 +410,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, 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 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, 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 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); - (*len) = nbytes; + (*len) = nbytes + header_bytes_written; if (rv == -1) { return errno; } |