mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 09:42:39 +08:00
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.
This commit is contained in:
parent
4aac91049f
commit
77d61350a4
@ -43,7 +43,7 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
u_char *prev;
|
u_char *prev;
|
||||||
off_t size, send, prev_send, aligned, sent, fprev;
|
off_t size, send, prev_send, aligned, sent, fprev;
|
||||||
off_t header_size, file_size;
|
off_t header_size, file_size;
|
||||||
ngx_uint_t eintr, complete;
|
ngx_uint_t eintr;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_buf_t *file;
|
ngx_buf_t *file;
|
||||||
ngx_array_t header, trailer;
|
ngx_array_t header, trailer;
|
||||||
@ -92,7 +92,6 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
file_size = 0;
|
file_size = 0;
|
||||||
header_size = 0;
|
header_size = 0;
|
||||||
eintr = 0;
|
eintr = 0;
|
||||||
complete = 0;
|
|
||||||
prev_send = send;
|
prev_send = send;
|
||||||
|
|
||||||
header.nelts = 0;
|
header.nelts = 0;
|
||||||
@ -311,10 +310,6 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
sent = rc > 0 ? rc : 0;
|
sent = rc > 0 ? rc : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send - prev_send == sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
@ -323,7 +318,7 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
u_char *prev;
|
u_char *prev;
|
||||||
off_t size, send, prev_send, aligned, sent, fprev;
|
off_t size, send, prev_send, aligned, sent, fprev;
|
||||||
size_t header_size, file_size;
|
size_t header_size, file_size;
|
||||||
ngx_uint_t eintr, eagain, complete;
|
ngx_uint_t eintr, eagain;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_buf_t *file;
|
ngx_buf_t *file;
|
||||||
ngx_array_t header, trailer;
|
ngx_array_t header, trailer;
|
||||||
@ -96,7 +96,6 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
file_size = 0;
|
file_size = 0;
|
||||||
header_size = 0;
|
header_size = 0;
|
||||||
eintr = 0;
|
eintr = 0;
|
||||||
complete = 0;
|
|
||||||
prev_send = send;
|
prev_send = send;
|
||||||
|
|
||||||
header.nelts = 0;
|
header.nelts = 0;
|
||||||
@ -362,10 +361,6 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
sent = rc > 0 ? rc : 0;
|
sent = rc > 0 ? rc : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send - prev_send == sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
@ -393,7 +388,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
size_t file_size;
|
size_t file_size;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_buf_t *file;
|
ngx_buf_t *file;
|
||||||
ngx_uint_t eintr, complete;
|
ngx_uint_t eintr;
|
||||||
ngx_array_t header;
|
ngx_array_t header;
|
||||||
ngx_event_t *wev;
|
ngx_event_t *wev;
|
||||||
ngx_chain_t *cl;
|
ngx_chain_t *cl;
|
||||||
@ -79,7 +79,6 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
file = NULL;
|
file = NULL;
|
||||||
file_size = 0;
|
file_size = 0;
|
||||||
eintr = 0;
|
eintr = 0;
|
||||||
complete = 0;
|
|
||||||
prev_send = send;
|
prev_send = send;
|
||||||
|
|
||||||
header.nelts = 0;
|
header.nelts = 0;
|
||||||
@ -319,10 +318,6 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent);
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send - prev_send == sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
@ -331,7 +326,7 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
off_t size, send, prev_send, aligned, fprev;
|
off_t size, send, prev_send, aligned, fprev;
|
||||||
size_t sent;
|
size_t sent;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
ngx_int_t eintr, complete;
|
ngx_int_t eintr;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
sendfilevec_t *sfv, sfvs[NGX_SENDFILEVECS];
|
sendfilevec_t *sfv, sfvs[NGX_SENDFILEVECS];
|
||||||
ngx_array_t vec;
|
ngx_array_t vec;
|
||||||
@ -89,7 +89,6 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
fprev = 0;
|
fprev = 0;
|
||||||
sfv = NULL;
|
sfv = NULL;
|
||||||
eintr = 0;
|
eintr = 0;
|
||||||
complete = 0;
|
|
||||||
sent = 0;
|
sent = 0;
|
||||||
prev_send = send;
|
prev_send = send;
|
||||||
|
|
||||||
@ -201,10 +200,6 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
||||||
"sendfilev: %z %z", n, sent);
|
"sendfilev: %z %z", n, sent);
|
||||||
|
|
||||||
if (send - prev_send == (off_t) sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
@ -213,7 +208,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != (off_t) sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
u_char *prev;
|
u_char *prev;
|
||||||
ssize_t n, size, sent;
|
ssize_t n, size, sent;
|
||||||
off_t send, prev_send;
|
off_t send, prev_send;
|
||||||
ngx_uint_t eintr, complete;
|
ngx_uint_t eintr;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_array_t vec;
|
ngx_array_t vec;
|
||||||
ngx_chain_t *cl;
|
ngx_chain_t *cl;
|
||||||
@ -64,7 +64,6 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
prev = NULL;
|
prev = NULL;
|
||||||
iov = NULL;
|
iov = NULL;
|
||||||
eintr = 0;
|
eintr = 0;
|
||||||
complete = 0;
|
|
||||||
prev_send = send;
|
prev_send = send;
|
||||||
|
|
||||||
vec.nelts = 0;
|
vec.nelts = 0;
|
||||||
@ -137,10 +136,6 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
|
||||||
|
|
||||||
if (send - prev_send == sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
cl = ngx_handle_sent_chain(in, sent);
|
cl = ngx_handle_sent_chain(in, sent);
|
||||||
@ -149,7 +144,7 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
int rc;
|
int rc;
|
||||||
u_char *prev;
|
u_char *prev;
|
||||||
u_long size, sent, send, prev_send;
|
u_long size, sent, send, prev_send;
|
||||||
ngx_uint_t complete;
|
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_event_t *wev;
|
ngx_event_t *wev;
|
||||||
ngx_array_t vec;
|
ngx_array_t vec;
|
||||||
@ -40,7 +39,6 @@ ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
send = 0;
|
send = 0;
|
||||||
complete = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WSABUFs must be 4-byte aligned otherwise
|
* WSABUFs must be 4-byte aligned otherwise
|
||||||
@ -113,15 +111,11 @@ ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
||||||
"WSASend: fd:%d, s:%ul", c->fd, sent);
|
"WSASend: fd:%d, s:%ul", c->fd, sent);
|
||||||
|
|
||||||
if (send - prev_send == sent) {
|
|
||||||
complete = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->sent += sent;
|
c->sent += sent;
|
||||||
|
|
||||||
cl = ngx_handle_sent_chain(in, sent);
|
cl = ngx_handle_sent_chain(in, sent);
|
||||||
|
|
||||||
if (!complete) {
|
if (send - prev_send != sent) {
|
||||||
wev->ready = 0;
|
wev->ready = 0;
|
||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user