summaryrefslogtreecommitdiff
path: root/network_io/unix/sendrecv.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-04-25 17:04:26 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-04-25 17:04:26 +0000
commit5383341919dccd5780f5e4bc1821638d96c73ea7 (patch)
tree561d10e1ebfbe893e80e3639bb54677fefea16cf /network_io/unix/sendrecv.c
parent5e96ca21032e45e89f4b23d3baef3d5858cec828 (diff)
downloadlibapr-5383341919dccd5780f5e4bc1821638d96c73ea7.tar.gz
Correct legacy crumbs from the new OS/X sendfile changes.
Submitted by: Geoff Greer <angryparsley mipsisrisc.com> Backports: r651651 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x@651652 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/unix/sendrecv.c')
-rw-r--r--network_io/unix/sendrecv.c7
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;
}