comparison src/http/ngx_http_upstream.c @ 5745:9d3a9c45fc43

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().
author Valentin Bartenev <vbart@nginx.com>
date Tue, 01 Jul 2014 20:52:08 +0400
parents c95d7882dfc9
children 35990c69b3ac
comparison
equal deleted inserted replaced
5744:42114bf12da0 5745:9d3a9c45fc43
1672 } 1672 }
1673 1673
1674 c->tcp_nopush = NGX_TCP_NOPUSH_UNSET; 1674 c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
1675 } 1675 }
1676 1676
1677 ngx_add_timer(c->read, u->conf->read_timeout);
1678
1679 if (c->read->ready) {
1680 ngx_http_upstream_process_header(r, u);
1681 return;
1682 }
1683
1684 u->write_event_handler = ngx_http_upstream_dummy_handler; 1677 u->write_event_handler = ngx_http_upstream_dummy_handler;
1685 1678
1686 if (ngx_handle_write_event(c->write, 0) != NGX_OK) { 1679 if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
1687 ngx_http_upstream_finalize_request(r, u, 1680 ngx_http_upstream_finalize_request(r, u,
1688 NGX_HTTP_INTERNAL_SERVER_ERROR); 1681 NGX_HTTP_INTERNAL_SERVER_ERROR);
1682 return;
1683 }
1684
1685 ngx_add_timer(c->read, u->conf->read_timeout);
1686
1687 if (c->read->ready) {
1688 ngx_http_upstream_process_header(r, u);
1689 return; 1689 return;
1690 } 1690 }
1691 } 1691 }
1692 1692
1693 1693