Welcome! Log In Create A New Profile

Advanced

Don't delete timer of write event when it's delayed.

Jiuzhou Cui
December 26, 2023 09:58PM
Hello!


# HG changeset patch
# User Jiuzhou Cui <cuijiuzhou@alibaba-inc.com>
# Date 1703645578 -28800
# Wed Dec 27 10:52:58 2023 +0800
# Node ID 474ae07e47272e435d81c0ca9e4867aae35c30ab
# Parent ee40e2b1d0833b46128a357fbc84c6e23be9be07
Don't delete timer of write event when it's delayed.


This will make download speed alway zero when limit_rate in body filter.


diff -r ee40e2b1d083 -r 474ae07e4727 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Mon Dec 25 21:15:48 2023 +0400
+++ b/src/http/ngx_http_upstream.c Wed Dec 27 10:52:58 2023 +0800
@@ -3787,11 +3787,13 @@
}
}


- if (downstream->write->active && !downstream->write->ready) {
- ngx_add_timer(downstream->write, clcf->send_timeout);
-
- } else if (downstream->write->timer_set) {
- ngx_del_timer(downstream->write);
+ if (!downstream->write->delayed) {
+ if (downstream->write->active && !downstream->write->ready) {
+ ngx_add_timer(downstream->write, clcf->send_timeout);
+
+ } else if (downstream->write->timer_set) {
+ ngx_del_timer(downstream->write);
+ }
}


if (upstream->read->eof || upstream->read->error) {_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Don't delete timer of write event when it's delayed.

Jiuzhou Cui 338 December 26, 2023 09:58PM

Re: Don't delete timer of write event when it's delayed.

Maxim Dounin 119 December 27, 2023 06:20AM

Re:Re: Don't delete timer of write event when it's delayed.

Jiuzhou Cui 116 December 27, 2023 07:40AM

Re: Re: Don't delete timer of write event when it's delayed.

Maxim Dounin 109 December 27, 2023 09:00AM

Re:Re: Re: Don't delete timer of write event when it's delayed.

Jiuzhou Cui 149 December 27, 2023 10:04PM



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

Online Users

Guests: 130
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