Mercurial > hg > nginx
comparison src/os/unix/ngx_linux_sendfile_chain.c @ 5851:150df089fe47
Removed the "complete" variable from various send chain functions.
It was made redundant by the previous change, since the "sent" variable
is no longer modified.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 13 Aug 2014 15:11:45 +0400 |
parents | f9c83484d9ce |
children | b63e829621ab |
comparison
equal
deleted
inserted
replaced
5850:f9c83484d9ce | 5851:150df089fe47 |
---|---|
41 off_t size, send, prev_send, aligned, sent, fprev; | 41 off_t size, send, prev_send, aligned, sent, fprev; |
42 u_char *prev; | 42 u_char *prev; |
43 size_t file_size; | 43 size_t file_size; |
44 ngx_err_t err; | 44 ngx_err_t err; |
45 ngx_buf_t *file; | 45 ngx_buf_t *file; |
46 ngx_uint_t eintr, complete; | 46 ngx_uint_t eintr; |
47 ngx_array_t header; | 47 ngx_array_t header; |
48 ngx_event_t *wev; | 48 ngx_event_t *wev; |
49 ngx_chain_t *cl; | 49 ngx_chain_t *cl; |
50 struct iovec *iov, headers[NGX_HEADERS]; | 50 struct iovec *iov, headers[NGX_HEADERS]; |
51 #if (NGX_HAVE_SENDFILE64) | 51 #if (NGX_HAVE_SENDFILE64) |
77 | 77 |
78 for ( ;; ) { | 78 for ( ;; ) { |
79 file = NULL; | 79 file = NULL; |
80 file_size = 0; | 80 file_size = 0; |
81 eintr = 0; | 81 eintr = 0; |
82 complete = 0; | |
83 prev_send = send; | 82 prev_send = send; |
84 | 83 |
85 header.nelts = 0; | 84 header.nelts = 0; |
86 | 85 |
87 prev = NULL; | 86 prev = NULL; |
317 sent = rc > 0 ? rc : 0; | 316 sent = rc > 0 ? rc : 0; |
318 | 317 |
319 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent); | 318 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent); |
320 } | 319 } |
321 | 320 |
322 if (send - prev_send == sent) { | |
323 complete = 1; | |
324 } | |
325 | |
326 c->sent += sent; | 321 c->sent += sent; |
327 | 322 |
328 in = ngx_handle_sent_chain(in, sent); | 323 in = ngx_handle_sent_chain(in, sent); |
329 | 324 |
330 if (eintr) { | 325 if (eintr) { |
331 continue; | 326 continue; |
332 } | 327 } |
333 | 328 |
334 if (!complete) { | 329 if (send - prev_send != sent) { |
335 wev->ready = 0; | 330 wev->ready = 0; |
336 return in; | 331 return in; |
337 } | 332 } |
338 | 333 |
339 if (send >= limit || in == NULL) { | 334 if (send >= limit || in == NULL) { |