Welcome! Log In Create A New Profile

Advanced

[nginx] Stream: do not split datagrams when limiting proxy rate.

Roman Arutyunyan
January 17, 2019 07:14AM
details: https://hg.nginx.org/nginx/rev/8acaa1161783
branches:
changeset: 7441:8acaa1161783
user: Roman Arutyunyan <arut@nginx.com>
date: Thu Dec 27 19:37:34 2018 +0300
description:
Stream: do not split datagrams when limiting proxy rate.

Previously, when using proxy_upload_rate and proxy_download_rate, the buffer
size for reading from a socket could be reduced as a result of rate limiting.
For connection-oriented protocols this behavior is normal since unread data will
normally be read at the next iteration. But for datagram-oriented protocols
this is not the case, and unread part of the datagram is lost.

Now buffer size is not limited for datagrams. Rate limiting still works in this
case by delaying the next reading event.

diffstat:

src/stream/ngx_stream_proxy_module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 6d4bc025c5a7 -r 8acaa1161783 src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c Mon Jan 14 20:36:23 2019 +0300
+++ b/src/stream/ngx_stream_proxy_module.c Thu Dec 27 19:37:34 2018 +0300
@@ -1593,7 +1593,7 @@ ngx_stream_proxy_process(ngx_stream_sess
break;
}

- if ((off_t) size > limit) {
+ if (c->type == SOCK_STREAM && (off_t) size > limit) {
size = (size_t) limit;
}
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Stream: do not split datagrams when limiting proxy rate.

Roman Arutyunyan 345 January 17, 2019 07:14AM



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

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready