Mercurial > hg > nginx
comparison src/os/win32/ngx_wsasend_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 | d620f497c50f |
children | 150df089fe47 |
comparison
equal
deleted
inserted
replaced
5849:810e97260edc | 5850:f9c83484d9ce |
---|---|
117 complete = 1; | 117 complete = 1; |
118 } | 118 } |
119 | 119 |
120 c->sent += sent; | 120 c->sent += sent; |
121 | 121 |
122 for (cl = in; cl; cl = cl->next) { | 122 cl = ngx_handle_sent_chain(in, sent); |
123 | |
124 if (ngx_buf_special(cl->buf)) { | |
125 continue; | |
126 } | |
127 | |
128 if (sent == 0) { | |
129 break; | |
130 } | |
131 | |
132 size = cl->buf->last - cl->buf->pos; | |
133 | |
134 if (sent >= size) { | |
135 sent -= size; | |
136 cl->buf->pos = cl->buf->last; | |
137 | |
138 continue; | |
139 } | |
140 | |
141 cl->buf->pos += sent; | |
142 | |
143 break; | |
144 } | |
145 | 123 |
146 if (!complete) { | 124 if (!complete) { |
147 wev->ready = 0; | 125 wev->ready = 0; |
148 return cl; | 126 return cl; |
149 } | 127 } |
306 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0, | 284 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0, |
307 "WSASend ovlp: fd:%d, s:%ul", c->fd, sent); | 285 "WSASend ovlp: fd:%d, s:%ul", c->fd, sent); |
308 | 286 |
309 c->sent += sent; | 287 c->sent += sent; |
310 | 288 |
311 for (cl = in; cl && sent > 0; cl = cl->next) { | 289 cl = ngx_handle_sent_chain(in, sent); |
312 if (ngx_buf_special(cl->buf)) { | |
313 continue; | |
314 } | |
315 | |
316 if (sent == 0) { | |
317 break; | |
318 } | |
319 | |
320 size = cl->buf->last - cl->buf->pos; | |
321 | |
322 if (sent >= size) { | |
323 sent -= size; | |
324 cl->buf->pos = cl->buf->last; | |
325 | |
326 continue; | |
327 } | |
328 | |
329 cl->buf->pos += sent; | |
330 | |
331 break; | |
332 } | |
333 | 290 |
334 if (cl) { | 291 if (cl) { |
335 wev->ready = 0; | 292 wev->ready = 0; |
336 | 293 |
337 } else { | 294 } else { |