Mercurial > hg > nginx
comparison src/os/unix/ngx_darwin_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 |
---|---|
73 | 73 |
74 trailer.iovs = trailers; | 74 trailer.iovs = trailers; |
75 trailer.nalloc = NGX_IOVS_PREALLOCATE; | 75 trailer.nalloc = NGX_IOVS_PREALLOCATE; |
76 | 76 |
77 for ( ;; ) { | 77 for ( ;; ) { |
78 file = NULL; | |
79 file_size = 0; | |
80 eintr = 0; | 78 eintr = 0; |
81 prev_send = send; | 79 prev_send = send; |
82 | 80 |
83 /* create the header iovec and coalesce the neighbouring bufs */ | 81 /* create the header iovec and coalesce the neighbouring bufs */ |
84 | 82 |
96 /* coalesce the neighbouring file bufs */ | 94 /* coalesce the neighbouring file bufs */ |
97 | 95 |
98 file_size = ngx_chain_coalesce_file(&cl, limit - send); | 96 file_size = ngx_chain_coalesce_file(&cl, limit - send); |
99 | 97 |
100 send += file_size; | 98 send += file_size; |
101 } | 99 |
102 | 100 if (header.count == 0) { |
103 if (file && header.count == 0) { | 101 |
104 | 102 /* |
105 /* create the trailer iovec and coalesce the neighbouring bufs */ | 103 * create the trailer iovec and coalesce the neighbouring bufs |
106 | 104 */ |
107 cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log); | 105 |
108 | 106 cl = ngx_output_chain_to_iovec(&trailer, cl, limit - send, c->log); |
109 if (cl == NGX_CHAIN_ERROR) { | 107 |
110 return NGX_CHAIN_ERROR; | 108 if (cl == NGX_CHAIN_ERROR) { |
111 } | 109 return NGX_CHAIN_ERROR; |
112 | 110 } |
113 send += trailer.size; | 111 |
114 } | 112 send += trailer.size; |
115 | 113 } |
116 if (file) { | |
117 | 114 |
118 /* | 115 /* |
119 * sendfile() returns EINVAL if sf_hdtr's count is 0, | 116 * sendfile() returns EINVAL if sf_hdtr's count is 0, |
120 * but corresponding pointer is not NULL | 117 * but corresponding pointer is not NULL |
121 */ | 118 */ |