|
| 1 | +diff -u ./src/core/ngx_core.h.orig ./src/core/ngx_core.h |
| 2 | +--- ./src/core/ngx_core.h.orig 2016-02-24 14:53:23.000000000 +0000 |
| 3 | ++++ ./src/core/ngx_core.h 2016-03-18 06:42:53.646390429 +0000 |
| 4 | +@@ -40,6 +40,7 @@ |
| 5 | + #define NGX_DONE -4 |
| 6 | + #define NGX_DECLINED -5 |
| 7 | + #define NGX_ABORT -6 |
| 8 | ++#define NGX_YIELD -7 |
| 9 | + |
| 10 | + |
| 11 | + #include <ngx_errno.h> |
| 12 | +diff -u ./src/event/ngx_event_connect.h.orig ./src/event/ngx_event_connect.h |
| 13 | +--- ./src/event/ngx_event_connect.h.orig 2016-02-24 14:53:23.000000000 +0000 |
| 14 | ++++ ./src/event/ngx_event_connect.h 2016-03-18 06:56:06.607130656 +0000 |
| 15 | +@@ -40,6 +40,7 @@ |
| 16 | + struct sockaddr *sockaddr; |
| 17 | + socklen_t socklen; |
| 18 | + ngx_str_t *name; |
| 19 | ++ ngx_str_t *host; |
| 20 | + |
| 21 | + ngx_uint_t tries; |
| 22 | + ngx_msec_t start_time; |
| 23 | +@@ -61,6 +62,8 @@ |
| 24 | + |
| 25 | + unsigned cached:1; |
| 26 | + |
| 27 | ++ unsigned resolved:2; |
| 28 | ++ |
| 29 | + /* ngx_connection_log_error_e */ |
| 30 | + unsigned log_error:2; |
| 31 | + }; |
| 32 | +diff -u ./src/http/ngx_http_upstream.c.orig ./src/http/ngx_http_upstream.c |
| 33 | +--- ./src/http/ngx_http_upstream.c.orig 2016-03-18 06:40:52.374968579 +0000 |
| 34 | ++++ ./src/http/ngx_http_upstream.c 2016-03-18 07:11:39.349626985 +0000 |
| 35 | +@@ -31,7 +31,7 @@ |
| 36 | + static void ngx_http_upstream_wr_check_broken_connection(ngx_http_request_t *r); |
| 37 | + static void ngx_http_upstream_check_broken_connection(ngx_http_request_t *r, |
| 38 | + ngx_event_t *ev); |
| 39 | +-static void ngx_http_upstream_connect(ngx_http_request_t *r, |
| 40 | ++void ngx_http_upstream_connect(ngx_http_request_t *r, |
| 41 | + ngx_http_upstream_t *u); |
| 42 | + static ngx_int_t ngx_http_upstream_reinit(ngx_http_request_t *r, |
| 43 | + ngx_http_upstream_t *u); |
| 44 | +@@ -88,7 +88,7 @@ |
| 45 | + static void ngx_http_upstream_next(ngx_http_request_t *r, |
| 46 | + ngx_http_upstream_t *u, ngx_uint_t ft_type); |
| 47 | + static void ngx_http_upstream_cleanup(void *data); |
| 48 | +-static void ngx_http_upstream_finalize_request(ngx_http_request_t *r, |
| 49 | ++void ngx_http_upstream_finalize_request(ngx_http_request_t *r, |
| 50 | + ngx_http_upstream_t *u, ngx_int_t rc); |
| 51 | + |
| 52 | + static ngx_int_t ngx_http_upstream_process_header_line(ngx_http_request_t *r, |
| 53 | +@@ -1318,7 +1318,7 @@ |
| 54 | + } |
| 55 | + |
| 56 | + |
| 57 | +-static void |
| 58 | ++void |
| 59 | + ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) |
| 60 | + { |
| 61 | + ngx_int_t rc; |
| 62 | +@@ -1344,6 +1344,9 @@ |
| 63 | + u->state->header_time = (ngx_msec_t) -1; |
| 64 | + |
| 65 | + rc = ngx_event_connect_peer(&u->peer); |
| 66 | ++ if (rc == NGX_YIELD) { |
| 67 | ++ return; |
| 68 | ++ } |
| 69 | + |
| 70 | + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
| 71 | + "http upstream connect: %i", rc); |
| 72 | +@@ -3942,7 +3945,7 @@ |
| 73 | + } |
| 74 | + |
| 75 | + |
| 76 | +-static void |
| 77 | ++void |
| 78 | + ngx_http_upstream_finalize_request(ngx_http_request_t *r, |
| 79 | + ngx_http_upstream_t *u, ngx_int_t rc) |
| 80 | + { |
| 81 | +diff -u ./src/http/ngx_http_upstream.h.orig ./src/http/ngx_http_upstream.h |
| 82 | +--- ./src/http/ngx_http_upstream.h.orig 2016-02-24 14:53:24.000000000 +0000 |
| 83 | ++++ ./src/http/ngx_http_upstream.h 2016-03-18 07:02:23.077597084 +0000 |
| 84 | +@@ -95,6 +95,8 @@ |
| 85 | + ngx_uint_t weight; |
| 86 | + ngx_uint_t max_fails; |
| 87 | + time_t fail_timeout; |
| 88 | ++ ngx_str_t id; |
| 89 | ++ ngx_str_t host; |
| 90 | + |
| 91 | + unsigned down:1; |
| 92 | + unsigned backup:1; |
| 93 | +@@ -315,6 +317,7 @@ |
| 94 | + ngx_http_upstream_headers_in_t headers_in; |
| 95 | + |
| 96 | + ngx_http_upstream_resolved_t *resolved; |
| 97 | ++ ngx_resolver_ctx_t *dyn_resolve_ctx; |
| 98 | + |
| 99 | + ngx_buf_t from_client; |
| 100 | + |
0 commit comments