Klaus Demo nginx / 7be6019
Upstream: u->request_body_blocked flag. The flag indicates whether last ngx_output_chain() returned NGX_AGAIN or not. If the flag is set, we arm the u->conf->send_timeout timer. The flag complements c->write->ready test, and allows to stop sending the request body in an output filter due to protocol-specific flow control. Maxim Dounin 2 years ago
2 changed file(s) with 20 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
16151615
16161616 u->request_sent = 0;
16171617 u->request_body_sent = 0;
1618 u->request_body_blocked = 0;
16181619
16191620 if (rc == NGX_AGAIN) {
16201621 ngx_add_timer(c->write, u->conf->connect_timeout);
19931994 }
19941995
19951996 if (rc == NGX_AGAIN) {
1996 if (!c->write->ready) {
1997 if (!c->write->ready || u->request_body_blocked) {
19971998 ngx_add_timer(c->write, u->conf->send_timeout);
19981999
19992000 } else if (c->write->timer_set) {
20702071 out = NULL;
20712072 }
20722073
2073 return ngx_output_chain(&u->output, out);
2074 rc = ngx_output_chain(&u->output, out);
2075
2076 if (rc == NGX_AGAIN) {
2077 u->request_body_blocked = 1;
2078
2079 } else {
2080 u->request_body_blocked = 0;
2081 }
2082
2083 return rc;
20742084 }
20752085
20762086 if (!u->request_sent) {
21092119 ln = out;
21102120 out = out->next;
21112121 ngx_free_chain(r->pool, ln);
2122 }
2123
2124 if (rc == NGX_AGAIN) {
2125 u->request_body_blocked = 1;
2126
2127 } else {
2128 u->request_body_blocked = 0;
21122129 }
21132130
21142131 if (rc == NGX_OK && !r->reading_body) {
390390
391391 unsigned request_sent:1;
392392 unsigned request_body_sent:1;
393 unsigned request_body_blocked:1;
393394 unsigned header_sent:1;
394395 };
395396