diff options
author | Valentin Bartenev <vbart@nginx.com> | 2014-08-13 15:11:45 +0400 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2014-08-13 15:11:45 +0400 |
commit | 79ddab189fb4bf27abd21a04bb9d1210e06384ac (patch) | |
tree | 5b356f0c4670abcfcb5120055e0928bb4ee18181 /src/os/unix/ngx_darwin_sendfile_chain.c | |
parent | d85d459bb2bfd147ea003310369d42c8891c6b39 (diff) | |
download | nginx-79ddab189fb4bf27abd21a04bb9d1210e06384ac.tar.gz nginx-79ddab189fb4bf27abd21a04bb9d1210e06384ac.zip |
Merged conditions in the ngx_*_sendfile_chain() functions.
No functional changes.
Diffstat (limited to 'src/os/unix/ngx_darwin_sendfile_chain.c')
-rw-r--r-- | src/os/unix/ngx_darwin_sendfile_chain.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/os/unix/ngx_darwin_sendfile_chain.c b/src/os/unix/ngx_darwin_sendfile_chain.c index a85269dcd..3caad0790 100644 --- a/src/os/unix/ngx_darwin_sendfile_chain.c +++ b/src/os/unix/ngx_darwin_sendfile_chain.c @@ -75,8 +75,6 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) trailer.nalloc = NGX_IOVS_PREALLOCATE; for ( ;; ) { - file = NULL; - file_size = 0; eintr = 0; prev_send = send; @@ -98,22 +96,21 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) file_size = ngx_chain_coalesce_file(&cl, limit - send); send += file_size; - } - - if (file && header.count == 0) { - /* create the trailer iovec and coalesce the neighbouring bufs */ + if (header.count == 0) { - cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log); + /* + * create the trailer iovec and coalesce the neighbouring bufs + */ - if (cl == NGX_CHAIN_ERROR) { - return NGX_CHAIN_ERROR; - } + cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log); - send += trailer.size; - } + if (cl == NGX_CHAIN_ERROR) { + return NGX_CHAIN_ERROR; + } - if (file) { + send += trailer.size; + } /* * sendfile() returns EINVAL if sf_hdtr's count is 0, |