From 2fb7a6aef06bbf59436a61e24067cd504fd6d5fc Mon Sep 17 00:00:00 2001 From: "yefei.dyf" Date: Sat, 8 Oct 2022 09:43:40 +0800 Subject: [PATCH] Bugfix: r->limit_rate does't work if limit_rate_set variable is not set nginx-patch: https://hg.nginx.org/nginx/rev/c19ca381b2e6\?revcount\=480 --- modules/ngx_http_tfs_module/ngx_http_tfs.c | 1 + modules/ngx_multi_upstream_module/ngx_http_multi_upstream.c | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/ngx_http_tfs_module/ngx_http_tfs.c b/modules/ngx_http_tfs_module/ngx_http_tfs.c index 852cb66b..dab327c5 100644 --- a/modules/ngx_http_tfs_module/ngx_http_tfs.c +++ b/modules/ngx_http_tfs_module/ngx_http_tfs.c @@ -1131,6 +1131,7 @@ ngx_http_tfs_send_response(ngx_http_request_t *r, ngx_http_tfs_t *t) r->write_event_handler = ngx_http_tfs_process_non_buffered_downstream; r->limit_rate = 0; + r->limit_rate_set = 1; if (clcf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay"); diff --git a/modules/ngx_multi_upstream_module/ngx_http_multi_upstream.c b/modules/ngx_multi_upstream_module/ngx_http_multi_upstream.c index cd52423d..d6f45eed 100644 --- a/modules/ngx_multi_upstream_module/ngx_http_multi_upstream.c +++ b/modules/ngx_multi_upstream_module/ngx_http_multi_upstream.c @@ -62,6 +62,7 @@ ngx_http_multi_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t ngx_http_upstream_process_non_buffered_downstream; r->limit_rate = 0; + r->limit_rate_set = 1; if (u->input_filter_init(u->input_filter_ctx) == NGX_ERROR) { ngx_http_upstream_finalize_request(r, u, NGX_ERROR);