# HG changeset patch # User Maxim Dounin # Date 1421164703 -10800 # Node ID 7554c83287dcd1baf3ef69b88734e5b8b67bbdc3 # Parent e9effef98874c619326ec11e25b11333225cf797 Fixed sendfile() trailers on OS X (8e903522c17a, 1.7.8). 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). diff -r e9effef98874 -r 7554c83287dc src/os/unix/ngx_darwin_sendfile_chain.c --- a/src/os/unix/ngx_darwin_sendfile_chain.c Fri Dec 26 16:22:59 2014 +0300 +++ b/src/os/unix/ngx_darwin_sendfile_chain.c Tue Jan 13 18:58:23 2015 +0300 @@ -111,6 +111,9 @@ } send += trailer.size; + + } else { + trailer.count = 0; } /*