mirror of
https://github.com/nginx/nginx.git
synced 2024-12-02 11:49:01 +08:00
Fixed counting of sent bytes in the send chain functions on EINTR.
Previously, a value of the "send" variable wasn't properly adjusted in a rare case when syscall was interrupted by a signal. As a result, these functions could send less data than the limit allows.
This commit is contained in:
parent
70995077ad
commit
840b347bb2
@ -308,6 +308,7 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
|
|
||||||
if (eintr) {
|
if (eintr) {
|
||||||
|
send = prev_send + sent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,6 +378,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (eintr) {
|
if (eintr) {
|
||||||
|
send = prev_send + sent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,6 +316,7 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
|
|
||||||
if (eintr) {
|
if (eintr) {
|
||||||
|
send = prev_send;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +200,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
|
|
||||||
if (eintr) {
|
if (eintr) {
|
||||||
|
send = prev_send + sent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +134,7 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
in = ngx_handle_sent_chain(in, sent);
|
in = ngx_handle_sent_chain(in, sent);
|
||||||
|
|
||||||
if (eintr) {
|
if (eintr) {
|
||||||
|
send = prev_send;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user