fixed the upstream_timeout_fields patch for nginx.

pull/301/head
Yichun Zhang (agentzh) 7 years ago
parent 3c114dbe46
commit 45a8fb27e4

@ -1,7 +1,8 @@
diff -r 13070ecfda67 src/http/ngx_http_upstream.c diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Tue Apr 19 19:02:37 2016 +0300 index c394b291..e10df0ab 100644
+++ b/src/http/ngx_http_upstream.c Fri Jul 01 12:14:53 2016 -0700 --- a/src/http/ngx_http_upstream.c
@@ -481,12 +481,19 @@ void +++ b/src/http/ngx_http_upstream.c
@@ -502,12 +502,19 @@ void
ngx_http_upstream_init(ngx_http_request_t *r) ngx_http_upstream_init(ngx_http_request_t *r)
{ {
ngx_connection_t *c; ngx_connection_t *c;
@ -21,7 +22,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
#if (NGX_HTTP_V2) #if (NGX_HTTP_V2)
if (r->stream) { if (r->stream) {
ngx_http_upstream_init_request(r); ngx_http_upstream_init_request(r);
@@ -1451,7 +1458,7 @@ ngx_http_upstream_connect(ngx_http_reque @@ -1590,7 +1597,7 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u)
u->request_body_sent = 0; u->request_body_sent = 0;
if (rc == NGX_AGAIN) { if (rc == NGX_AGAIN) {
@ -30,7 +31,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
return; return;
} }
@@ -1540,7 +1547,7 @@ ngx_http_upstream_ssl_init_connection(ng @@ -1666,7 +1673,7 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
if (rc == NGX_AGAIN) { if (rc == NGX_AGAIN) {
if (!c->write->timer_set) { if (!c->write->timer_set) {
@ -38,8 +39,8 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
+ ngx_add_timer(c->write, u->connect_timeout); + ngx_add_timer(c->write, u->connect_timeout);
} }
c->ssl->handler = ngx_http_upstream_ssl_handshake; c->ssl->handler = ngx_http_upstream_ssl_handshake_handler;
@@ -1816,7 +1823,7 @@ ngx_http_upstream_send_request(ngx_http_ @@ -1960,7 +1967,7 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u,
if (rc == NGX_AGAIN) { if (rc == NGX_AGAIN) {
if (!c->write->ready) { if (!c->write->ready) {
@ -48,7 +49,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
} else if (c->write->timer_set) { } else if (c->write->timer_set) {
ngx_del_timer(c->write); ngx_del_timer(c->write);
@@ -1859,7 +1866,7 @@ ngx_http_upstream_send_request(ngx_http_ @@ -2003,7 +2010,7 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u,
return; return;
} }
@ -57,7 +58,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
if (c->read->ready) { if (c->read->ready) {
ngx_http_upstream_process_header(r, u); ngx_http_upstream_process_header(r, u);
@@ -2658,7 +2665,7 @@ ngx_http_upstream_process_body_in_memory @@ -2800,7 +2807,7 @@ ngx_http_upstream_process_body_in_memory(ngx_http_request_t *r,
} }
if (rev->active) { if (rev->active) {
@ -66,7 +67,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
} else if (rev->timer_set) { } else if (rev->timer_set) {
ngx_del_timer(rev); ngx_del_timer(rev);
@@ -2982,7 +2989,7 @@ ngx_http_upstream_send_response(ngx_http @@ -3129,7 +3136,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
p->cyclic_temp_file = 0; p->cyclic_temp_file = 0;
} }
@ -75,7 +76,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
p->send_timeout = clcf->send_timeout; p->send_timeout = clcf->send_timeout;
p->send_lowat = clcf->send_lowat; p->send_lowat = clcf->send_lowat;
@@ -3239,7 +3246,7 @@ ngx_http_upstream_process_upgraded(ngx_h @@ -3367,7 +3374,7 @@ ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
} }
if (upstream->write->active && !upstream->write->ready) { if (upstream->write->active && !upstream->write->ready) {
@ -84,7 +85,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
} else if (upstream->write->timer_set) { } else if (upstream->write->timer_set) {
ngx_del_timer(upstream->write); ngx_del_timer(upstream->write);
@@ -3251,7 +3258,7 @@ ngx_http_upstream_process_upgraded(ngx_h @@ -3379,7 +3386,7 @@ ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
} }
if (upstream->read->active && !upstream->read->ready) { if (upstream->read->active && !upstream->read->ready) {
@ -93,7 +94,7 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
} else if (upstream->read->timer_set) { } else if (upstream->read->timer_set) {
ngx_del_timer(upstream->read); ngx_del_timer(upstream->read);
@@ -3444,7 +3451,7 @@ ngx_http_upstream_process_non_buffered_r @@ -3573,7 +3580,7 @@ ngx_http_upstream_process_non_buffered_request(ngx_http_request_t *r,
} }
if (upstream->read->active && !upstream->read->ready) { if (upstream->read->active && !upstream->read->ready) {
@ -102,19 +103,19 @@ diff -r 13070ecfda67 src/http/ngx_http_upstream.c
} else if (upstream->read->timer_set) { } else if (upstream->read->timer_set) {
ngx_del_timer(upstream->read); ngx_del_timer(upstream->read);
diff -r 13070ecfda67 src/http/ngx_http_upstream.h diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h
--- a/src/http/ngx_http_upstream.h Tue Apr 19 19:02:37 2016 +0300 index c552ac0c..40b69d0a 100644
+++ b/src/http/ngx_http_upstream.h Fri Jul 01 12:14:53 2016 -0700 --- a/src/http/ngx_http_upstream.h
@@ -309,6 +309,12 @@ struct ngx_http_upstream_s { +++ b/src/http/ngx_http_upstream.h
ngx_chain_writer_ctx_t writer; @@ -329,6 +329,11 @@ struct ngx_http_upstream_s {
ngx_array_t *caches;
#endif
ngx_http_upstream_conf_t *conf;
+
+#define HAVE_NGX_UPSTREAM_TIMEOUT_FIELDS 1 +#define HAVE_NGX_UPSTREAM_TIMEOUT_FIELDS 1
+ ngx_msec_t connect_timeout; + ngx_msec_t connect_timeout;
+ ngx_msec_t send_timeout; + ngx_msec_t send_timeout;
+ ngx_msec_t read_timeout; + ngx_msec_t read_timeout;
+ +
#if (NGX_HTTP_CACHE) ngx_http_upstream_headers_in_t headers_in;
ngx_array_t *caches;
#endif ngx_http_upstream_resolved_t *resolved;

Loading…
Cancel
Save