comparison src/os/unix/ngx_solaris_sendfilev_chain.c @ 5850:f9c83484d9ce

Moved the code for adjusting sent buffers in a separate function.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 13 Aug 2014 15:11:45 +0400
parents ad137a80919f
children 150df089fe47
comparison
equal deleted inserted replaced
5849:810e97260edc 5850:f9c83484d9ce
205 complete = 1; 205 complete = 1;
206 } 206 }
207 207
208 c->sent += sent; 208 c->sent += sent;
209 209
210 for ( /* void */ ; in; in = in->next) { 210 in = ngx_handle_sent_chain(in, sent);
211
212 if (ngx_buf_special(in->buf)) {
213 continue;
214 }
215
216 if (sent == 0) {
217 break;
218 }
219
220 size = ngx_buf_size(in->buf);
221
222 if ((off_t) sent >= size) {
223 sent = (size_t) ((off_t) sent - size);
224
225 if (ngx_buf_in_memory(in->buf)) {
226 in->buf->pos = in->buf->last;
227 }
228
229 if (in->buf->in_file) {
230 in->buf->file_pos = in->buf->file_last;
231 }
232
233 continue;
234 }
235
236 if (ngx_buf_in_memory(in->buf)) {
237 in->buf->pos += sent;
238 }
239
240 if (in->buf->in_file) {
241 in->buf->file_pos += sent;
242 }
243
244 break;
245 }
246 211
247 if (eintr) { 212 if (eintr) {
248 continue; 213 continue;
249 } 214 }
250 215