From 4aac91049f8909e928580f9fb8b752ba748f4167 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 13 Aug 2014 15:11:45 +0400 Subject: Moved the code for adjusting sent buffers in a separate function. --- src/os/unix/ngx_writev_chain.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/os/unix/ngx_writev_chain.c') diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c index 805982d65..ff16f86e3 100644 --- a/src/os/unix/ngx_writev_chain.c +++ b/src/os/unix/ngx_writev_chain.c @@ -143,29 +143,7 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) c->sent += sent; - for (cl = in; cl; cl = cl->next) { - - if (ngx_buf_special(cl->buf)) { - continue; - } - - if (sent == 0) { - break; - } - - size = cl->buf->last - cl->buf->pos; - - if (sent >= size) { - sent -= size; - cl->buf->pos = cl->buf->last; - - continue; - } - - cl->buf->pos += sent; - - break; - } + cl = ngx_handle_sent_chain(in, sent); if (eintr) { continue; -- cgit