# 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 --git a/src/os/unix/ngx_darwin_sendfile_chain.c b/src/os/unix/ngx_darwin_sendfile_chain.c --- a/src/os/unix/ngx_darwin_sendfile_chain.c +++ b/src/os/unix/ngx_darwin_sendfile_chain.c @@ -111,6 +111,9 @@ ngx_darwin_sendfile_chain(ngx_connection } send += trailer.size; + + } else { + trailer.count = 0; } /*