aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_linux_sendfile_chain.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-08-13 15:11:45 +0400
committerValentin Bartenev <vbart@nginx.com>2014-08-13 15:11:45 +0400
commit4aac91049f8909e928580f9fb8b752ba748f4167 (patch)
tree3100acd79e0cf9e317878113207b0e942705a88c /src/os/unix/ngx_linux_sendfile_chain.c
parent8b6f1c7bb064aa87ab83fbf3d8ed9f9e80e1b06b (diff)
downloadnginx-4aac91049f8909e928580f9fb8b752ba748f4167.tar.gz
nginx-4aac91049f8909e928580f9fb8b752ba748f4167.zip
Moved the code for adjusting sent buffers in a separate function.
Diffstat (limited to 'src/os/unix/ngx_linux_sendfile_chain.c')
-rw-r--r--src/os/unix/ngx_linux_sendfile_chain.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c b/src/os/unix/ngx_linux_sendfile_chain.c
index 16395f943..3e6fc6dd8 100644
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -325,42 +325,7 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
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 (sent >= size) {
- 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 += (size_t) sent;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos += sent;
- }
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
if (eintr) {
continue;