mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 14:13:33 -06:00
Merged conditions in the ngx_*_sendfile_chain() functions.
No functional changes.
This commit is contained in:
parent
d85d459bb2
commit
79ddab189f
@ -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,11 +96,12 @@ 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) {
|
||||
if (header.count == 0) {
|
||||
|
||||
/* create the trailer iovec and coalesce the neighbouring bufs */
|
||||
/*
|
||||
* create the trailer iovec and coalesce the neighbouring bufs
|
||||
*/
|
||||
|
||||
cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log);
|
||||
|
||||
@ -113,8 +112,6 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
||||
send += trailer.size;
|
||||
}
|
||||
|
||||
if (file) {
|
||||
|
||||
/*
|
||||
* sendfile() returns EINVAL if sf_hdtr's count is 0,
|
||||
* but corresponding pointer is not NULL
|
||||
|
@ -79,8 +79,6 @@ ngx_freebsd_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;
|
||||
|
||||
@ -102,10 +100,6 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
||||
file_size = (size_t) ngx_chain_coalesce_file(&cl, limit - send);
|
||||
|
||||
send += file_size;
|
||||
}
|
||||
|
||||
|
||||
if (file) {
|
||||
|
||||
/* create the trailer iovec and coalesce the neighbouring bufs */
|
||||
|
||||
@ -116,9 +110,6 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
||||
}
|
||||
|
||||
send += trailer.size;
|
||||
}
|
||||
|
||||
if (file) {
|
||||
|
||||
if (ngx_freebsd_use_tcp_nopush
|
||||
&& c->tcp_nopush == NGX_TCP_NOPUSH_UNSET)
|
||||
|
@ -66,8 +66,6 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
||||
header.nalloc = NGX_IOVS_PREALLOCATE;
|
||||
|
||||
for ( ;; ) {
|
||||
file = NULL;
|
||||
file_size = 0;
|
||||
eintr = 0;
|
||||
prev_send = send;
|
||||
|
||||
@ -156,9 +154,6 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
||||
file_size = (size_t) ngx_chain_coalesce_file(&cl, limit - send);
|
||||
|
||||
send += file_size;
|
||||
}
|
||||
|
||||
if (file) {
|
||||
#if 1
|
||||
if (file_size == 0) {
|
||||
ngx_debug_point();
|
||||
|
Loading…
Reference in New Issue
Block a user