comparison src/os/unix/ngx_freebsd_sendfile_chain.c @ 5916:e044893b4587

Merged conditions in the ngx_*_sendfile_chain() functions. No functional changes.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 13 Aug 2014 15:11:45 +0400
parents ac3f78219f85
children 2c64b69daec5
comparison
equal deleted inserted replaced
5915:ac3f78219f85 5916:e044893b4587
77 77
78 trailer.iovs = trailers; 78 trailer.iovs = trailers;
79 trailer.nalloc = NGX_IOVS_PREALLOCATE; 79 trailer.nalloc = NGX_IOVS_PREALLOCATE;
80 80
81 for ( ;; ) { 81 for ( ;; ) {
82 file = NULL;
83 file_size = 0;
84 eintr = 0; 82 eintr = 0;
85 prev_send = send; 83 prev_send = send;
86 84
87 /* create the header iovec and coalesce the neighbouring bufs */ 85 /* create the header iovec and coalesce the neighbouring bufs */
88 86
100 /* coalesce the neighbouring file bufs */ 98 /* coalesce the neighbouring file bufs */
101 99
102 file_size = (size_t) ngx_chain_coalesce_file(&cl, limit - send); 100 file_size = (size_t) ngx_chain_coalesce_file(&cl, limit - send);
103 101
104 send += file_size; 102 send += file_size;
105 }
106
107
108 if (file) {
109 103
110 /* create the trailer iovec and coalesce the neighbouring bufs */ 104 /* create the trailer iovec and coalesce the neighbouring bufs */
111 105
112 cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log); 106 cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log);
113 107
114 if (cl == NGX_CHAIN_ERROR) { 108 if (cl == NGX_CHAIN_ERROR) {
115 return NGX_CHAIN_ERROR; 109 return NGX_CHAIN_ERROR;
116 } 110 }
117 111
118 send += trailer.size; 112 send += trailer.size;
119 }
120
121 if (file) {
122 113
123 if (ngx_freebsd_use_tcp_nopush 114 if (ngx_freebsd_use_tcp_nopush
124 && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET) 115 && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET)
125 { 116 {
126 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { 117 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {