diff 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
line wrap: on
line diff
--- a/src/os/unix/ngx_solaris_sendfilev_chain.c
+++ b/src/os/unix/ngx_solaris_sendfilev_chain.c
@@ -207,42 +207,7 @@ ngx_solaris_sendfilev_chain(ngx_connecti
 
         c->sent += sent;
 
-        for ( /* void */ ; in; in = in->next) {
-
-            if (ngx_buf_special(in->buf)) {
-                continue;
-            }
-
-            if (sent == 0) {
-                break;
-            }
-
-            size = ngx_buf_size(in->buf);
-
-            if ((off_t) sent >= size) {
-                sent = (size_t) ((off_t) sent - size);
-
-                if (ngx_buf_in_memory(in->buf)) {
-                    in->buf->pos = in->buf->last;
-                }
-
-                if (in->buf->in_file) {
-                    in->buf->file_pos = in->buf->file_last;
-                }
-
-                continue;
-            }
-
-            if (ngx_buf_in_memory(in->buf)) {
-                in->buf->pos += sent;
-            }
-
-            if (in->buf->in_file) {
-                in->buf->file_pos += sent;
-            }
-
-            break;
-        }
+        in = ngx_handle_sent_chain(in, sent);
 
         if (eintr) {
             continue;