comparison src/os/unix/ngx_darwin_sendfile_chain.c @ 5961:7554c83287dc

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).
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 13 Jan 2015 18:58:23 +0300
parents fddc6bed1e6e
children 7cc2d3a96ea3
comparison
equal deleted inserted replaced
5960:e9effef98874 5961:7554c83287dc
109 if (cl == NGX_CHAIN_ERROR) { 109 if (cl == NGX_CHAIN_ERROR) {
110 return NGX_CHAIN_ERROR; 110 return NGX_CHAIN_ERROR;
111 } 111 }
112 112
113 send += trailer.size; 113 send += trailer.size;
114
115 } else {
116 trailer.count = 0;
114 } 117 }
115 118
116 /* 119 /*
117 * sendfile() returns EINVAL if sf_hdtr's count is 0, 120 * sendfile() returns EINVAL if sf_hdtr's count is 0,
118 * but corresponding pointer is not NULL 121 * but corresponding pointer is not NULL