Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: fixed handling of write event after sending re...

Valentin Bartenev
July 02, 2014 08:02AM
details: http://hg.nginx.org/nginx/rev/9d3a9c45fc43
branches:
changeset: 5745:9d3a9c45fc43
user: Valentin Bartenev <vbart@nginx.com>
date: Tue Jul 01 20:52:08 2014 +0400
description:
Upstream: fixed handling of write event after sending request.

The ngx_http_upstream_dummy_handler() must be set regardless of
the read event state. This prevents possible additional call of
ngx_http_upstream_send_request_handler().

diffstat:

src/http/ngx_http_upstream.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diffs (31 lines):

diff -r 42114bf12da0 -r 9d3a9c45fc43 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Mon Jun 16 19:43:25 2014 +0400
+++ b/src/http/ngx_http_upstream.c Tue Jul 01 20:52:08 2014 +0400
@@ -1674,13 +1674,6 @@ ngx_http_upstream_send_request(ngx_http_
c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
}

- ngx_add_timer(c->read, u->conf->read_timeout);
-
- if (c->read->ready) {
- ngx_http_upstream_process_header(r, u);
- return;
- }
-
u->write_event_handler = ngx_http_upstream_dummy_handler;

if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
@@ -1688,6 +1681,13 @@ ngx_http_upstream_send_request(ngx_http_
NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
}
+
+ ngx_add_timer(c->read, u->conf->read_timeout);
+
+ if (c->read->ready) {
+ ngx_http_upstream_process_header(r, u);
+ return;
+ }
}



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

[nginx] Upstream: fixed handling of write event after sending re...

Valentin Bartenev 658 July 02, 2014 08:02AM



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

Online Users

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