comparison 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
comparison
equal deleted inserted replaced
5849:810e97260edc 5850:f9c83484d9ce
141 complete = 1; 141 complete = 1;
142 } 142 }
143 143
144 c->sent += sent; 144 c->sent += sent;
145 145
146 for (cl = in; cl; cl = cl->next) { 146 cl = ngx_handle_sent_chain(in, sent);
147
148 if (ngx_buf_special(cl->buf)) {
149 continue;
150 }
151
152 if (sent == 0) {
153 break;
154 }
155
156 size = cl->buf->last - cl->buf->pos;
157
158 if (sent >= size) {
159 sent -= size;
160 cl->buf->pos = cl->buf->last;
161
162 continue;
163 }
164
165 cl->buf->pos += sent;
166
167 break;
168 }
169 147
170 if (eintr) { 148 if (eintr) {
171 continue; 149 continue;
172 } 150 }
173 151