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
e9089c5f96
commit
ad5fe53010
5 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
||||
if (eintr) {
|
||||
send = prev_send + sent;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -378,6 +378,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||
}
|
||||
|
||||
if (eintr) {
|
||||
send = prev_send + sent;
|
||||
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);
|
||||
|
||||
if (eintr) {
|
||||
send = prev_send;
|
||||
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);
|
||||
|
||||
if (eintr) {
|
||||
send = prev_send + sent;
|
||||
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);
|
||||
|
||||
if (eintr) {
|
||||
send = prev_send;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue