]> git.kaiwu.me - nginx.git/commitdiff
Fixed sendfile() trailers on OS X (8e903522c17a, 1.7.8).
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 13 Jan 2015 15:58:23 +0000 (18:58 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 13 Jan 2015 15:58:23 +0000 (18:58 +0300)
The trailer.count variable was not initialized if there was a header,
resulting in "sendfile() failed (22: Invalid argument)" alerts on OS X
if the "sendfile" directive was used.  The bug was introduced
in 8e903522c17a (1.7.8).

src/os/unix/ngx_darwin_sendfile_chain.c

index f01651a11501bd704c9175cc34b4b5d66bd81cab..c802e9f9a163dff8627651a55424db35e4255ed1 100644 (file)
@@ -111,6 +111,9 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
                 }
 
                 send += trailer.size;
+
+            } else {
+                trailer.count = 0;
             }
 
             /*