Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed counting of sent bytes in the send chain functions...

Valentin Bartenev
October 02, 2014 02:38PM
details: http://hg.nginx.org/nginx/rev/6bbad2e73245
branches:
changeset: 5868:6bbad2e73245
user: Valentin Bartenev <vbart@nginx.com>
date: Wed Aug 27 20:51:01 2014 +0400
description:
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:

src/os/unix/ngx_darwin_sendfile_chain.c | 1 +
src/os/unix/ngx_freebsd_sendfile_chain.c | 1 +
src/os/unix/ngx_linux_sendfile_chain.c | 1 +
src/os/unix/ngx_solaris_sendfilev_chain.c | 1 +
src/os/unix/ngx_writev_chain.c | 1 +
5 files changed, 5 insertions(+), 0 deletions(-)

diffs (55 lines):

diff -r 26d28506282a -r 6bbad2e73245 src/os/unix/ngx_darwin_sendfile_chain.c
--- a/src/os/unix/ngx_darwin_sendfile_chain.c Thu Oct 02 22:36:27 2014 +0400
+++ b/src/os/unix/ngx_darwin_sendfile_chain.c Wed Aug 27 20:51:01 2014 +0400
@@ -308,6 +308,7 @@ ngx_darwin_sendfile_chain(ngx_connection
in = ngx_handle_sent_chain(in, sent);

if (eintr) {
+ send = prev_send + sent;
continue;
}

diff -r 26d28506282a -r 6bbad2e73245 src/os/unix/ngx_freebsd_sendfile_chain.c
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c Thu Oct 02 22:36:27 2014 +0400
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c Wed Aug 27 20:51:01 2014 +0400
@@ -378,6 +378,7 @@ ngx_freebsd_sendfile_chain(ngx_connectio
}

if (eintr) {
+ send = prev_send + sent;
continue;
}

diff -r 26d28506282a -r 6bbad2e73245 src/os/unix/ngx_linux_sendfile_chain.c
--- a/src/os/unix/ngx_linux_sendfile_chain.c Thu Oct 02 22:36:27 2014 +0400
+++ b/src/os/unix/ngx_linux_sendfile_chain.c Wed Aug 27 20:51:01 2014 +0400
@@ -316,6 +316,7 @@ ngx_linux_sendfile_chain(ngx_connection_
in = ngx_handle_sent_chain(in, sent);

if (eintr) {
+ send = prev_send;
continue;
}

diff -r 26d28506282a -r 6bbad2e73245 src/os/unix/ngx_solaris_sendfilev_chain.c
--- a/src/os/unix/ngx_solaris_sendfilev_chain.c Thu Oct 02 22:36:27 2014 +0400
+++ b/src/os/unix/ngx_solaris_sendfilev_chain.c Wed Aug 27 20:51:01 2014 +0400
@@ -200,6 +200,7 @@ ngx_solaris_sendfilev_chain(ngx_connecti
in = ngx_handle_sent_chain(in, sent);

if (eintr) {
+ send = prev_send + sent;
continue;
}

diff -r 26d28506282a -r 6bbad2e73245 src/os/unix/ngx_writev_chain.c
--- a/src/os/unix/ngx_writev_chain.c Thu Oct 02 22:36:27 2014 +0400
+++ b/src/os/unix/ngx_writev_chain.c Wed Aug 27 20:51:01 2014 +0400
@@ -134,6 +134,7 @@ ngx_writev_chain(ngx_connection_t *c, ng
in = ngx_handle_sent_chain(in, sent);

if (eintr) {
+ send = prev_send;
continue;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed counting of sent bytes in the send chain functions...

Valentin Bartenev 693 October 02, 2014 02:38PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready