aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_darwin_sendfile_chain.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-08-27 20:51:01 +0400
committerValentin Bartenev <vbart@nginx.com>2014-08-27 20:51:01 +0400
commit840b347bb24bea09f9824891239929cdce84e47b (patch)
tree5d15de6ef6f0da2f44d6a5dd646330453a12ca78 /src/os/unix/ngx_darwin_sendfile_chain.c
parent70995077ad9866b6c85d7fbb86d31bc5445bc821 (diff)
downloadnginx-840b347bb24bea09f9824891239929cdce84e47b.tar.gz
nginx-840b347bb24bea09f9824891239929cdce84e47b.zip
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.
Diffstat (limited to 'src/os/unix/ngx_darwin_sendfile_chain.c')
-rw-r--r--src/os/unix/ngx_darwin_sendfile_chain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/os/unix/ngx_darwin_sendfile_chain.c b/src/os/unix/ngx_darwin_sendfile_chain.c
index dd574e5ac..8485f9749 100644
--- a/src/os/unix/ngx_darwin_sendfile_chain.c
+++ b/src/os/unix/ngx_darwin_sendfile_chain.c
@@ -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;
}