apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Greer <angrypars...@mipsisrisc.com>
Subject Re: Patch to fix sendfile on OS X
Date Fri, 25 Apr 2008 01:38:25 GMT
Ugh, I actually broke apr_socket_sendfile on OS X when I cleaned up my  
code for submission. Here is a patch for my patch.

Fixes are:

1. nbytes is initialized properly so if we only send the header we  
don't lie and say we sent header bytes + file length.
-    apr_off_t nbytes = *len;
+    apr_off_t nbytes = 0;

2. Vestigial code removed.
-            else {
-                header_bytes_written = 0;
-            }

3. Bytes sent in the header are now counted.
-    (*len) = nbytes;
+    (*len) = nbytes + header_bytes_written;

Patch attached, hopefully in text/plain.

Geoff

Mime
View raw message