comparison src/os/unix/ngx_linux_sendfile_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 188481078faf
children 150df089fe47
comparison
equal deleted inserted replaced
5849:810e97260edc 5850:f9c83484d9ce
323 complete = 1; 323 complete = 1;
324 } 324 }
325 325
326 c->sent += sent; 326 c->sent += sent;
327 327
328 for ( /* void */ ; in; in = in->next) { 328 in = ngx_handle_sent_chain(in, sent);
329
330 if (ngx_buf_special(in->buf)) {
331 continue;
332 }
333
334 if (sent == 0) {
335 break;
336 }
337
338 size = ngx_buf_size(in->buf);
339
340 if (sent >= size) {
341 sent -= size;
342
343 if (ngx_buf_in_memory(in->buf)) {
344 in->buf->pos = in->buf->last;
345 }
346
347 if (in->buf->in_file) {
348 in->buf->file_pos = in->buf->file_last;
349 }
350
351 continue;
352 }
353
354 if (ngx_buf_in_memory(in->buf)) {
355 in->buf->pos += (size_t) sent;
356 }
357
358 if (in->buf->in_file) {
359 in->buf->file_pos += sent;
360 }
361
362 break;
363 }
364 329
365 if (eintr) { 330 if (eintr) {
366 continue; 331 continue;
367 } 332 }
368 333