mirror of
https://github.com/nginx/nginx.git
synced 2025-06-10 19:42:39 +08:00
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().
This commit is contained in:
parent
9f8785ae5e
commit
3c2b5e88ab
@ -1674,13 +1674,6 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
|
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;
|
u->write_event_handler = ngx_http_upstream_dummy_handler;
|
||||||
|
|
||||||
if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
|
if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
|
||||||
@ -1688,6 +1681,13 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
NGX_HTTP_INTERNAL_SERVER_ERROR);
|
NGX_HTTP_INTERNAL_SERVER_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngx_add_timer(c->read, u->conf->read_timeout);
|
||||||
|
|
||||||
|
if (c->read->ready) {
|
||||||
|
ngx_http_upstream_process_header(r, u);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user