diff src/os/unix/ngx_writev_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 089cc5154c1e
children 150df089fe47
line wrap: on
line diff
--- 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, ng
 
         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;