comparison src/os/unix/ngx_writev_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 a6e83ac70af9
comparison
equal deleted inserted replaced
5850:f9c83484d9ce 5851:150df089fe47
21 ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) 21 ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
22 { 22 {
23 u_char *prev; 23 u_char *prev;
24 ssize_t n, size, sent; 24 ssize_t n, size, sent;
25 off_t send, prev_send; 25 off_t send, prev_send;
26 ngx_uint_t eintr, complete; 26 ngx_uint_t eintr;
27 ngx_err_t err; 27 ngx_err_t err;
28 ngx_array_t vec; 28 ngx_array_t vec;
29 ngx_chain_t *cl; 29 ngx_chain_t *cl;
30 ngx_event_t *wev; 30 ngx_event_t *wev;
31 struct iovec *iov, iovs[NGX_IOVS]; 31 struct iovec *iov, iovs[NGX_IOVS];
62 62
63 for ( ;; ) { 63 for ( ;; ) {
64 prev = NULL; 64 prev = NULL;
65 iov = NULL; 65 iov = NULL;
66 eintr = 0; 66 eintr = 0;
67 complete = 0;
68 prev_send = send; 67 prev_send = send;
69 68
70 vec.nelts = 0; 69 vec.nelts = 0;
71 70
72 /* create the iovec and coalesce the neighbouring bufs */ 71 /* create the iovec and coalesce the neighbouring bufs */
135 134
136 sent = n > 0 ? n : 0; 135 sent = n > 0 ? n : 0;
137 136
138 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent); 137 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
139 138
140 if (send - prev_send == sent) {
141 complete = 1;
142 }
143
144 c->sent += sent; 139 c->sent += sent;
145 140
146 cl = ngx_handle_sent_chain(in, sent); 141 cl = ngx_handle_sent_chain(in, sent);
147 142
148 if (eintr) { 143 if (eintr) {
149 continue; 144 continue;
150 } 145 }
151 146
152 if (!complete) { 147 if (send - prev_send != sent) {
153 wev->ready = 0; 148 wev->ready = 0;
154 return cl; 149 return cl;
155 } 150 }
156 151
157 if (send >= limit || cl == NULL) { 152 if (send >= limit || cl == NULL) {