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