|
| 1 | +diff --git a/src/http/modules/ngx_http_upstream_hash_module.c b/src/http/modules/ngx_http_upstream_hash_module.c |
| 2 | +index 777e180..e302f52 100644 |
| 3 | +--- a/src/http/modules/ngx_http_upstream_hash_module.c |
| 4 | ++++ b/src/http/modules/ngx_http_upstream_hash_module.c |
| 5 | +@@ -9,6 +9,9 @@ |
| 6 | + #include <ngx_core.h> |
| 7 | + #include <ngx_http.h> |
| 8 | + |
| 9 | ++#if (NGX_HTTP_UPSTREAM_CHECK) |
| 10 | ++#include "ngx_http_upstream_check_module.h" |
| 11 | ++#endif |
| 12 | + |
| 13 | + typedef struct { |
| 14 | + uint32_t hash; |
| 15 | +@@ -240,6 +243,14 @@ ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data) |
| 16 | + goto next; |
| 17 | + } |
| 18 | + |
| 19 | ++#if (NGX_HTTP_UPSTREAM_CHECK) |
| 20 | ++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
| 21 | ++ "get hash peer, check_index: %ui", |
| 22 | ++ peer->check_index); |
| 23 | ++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
| 24 | ++ goto next; |
| 25 | ++ } |
| 26 | ++#endif |
| 27 | + if (peer->max_fails |
| 28 | + && peer->fails >= peer->max_fails |
| 29 | + && now - peer->checked <= peer->fail_timeout) |
| 30 | +@@ -506,6 +517,14 @@ ngx_http_upstream_get_chash_peer(ngx_peer_connection_t *pc, void *data) |
| 31 | + continue; |
| 32 | + } |
| 33 | + |
| 34 | ++#if (NGX_HTTP_UPSTREAM_CHECK) |
| 35 | ++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
| 36 | ++ "get consistent_hash peer, check_index: %ui", |
| 37 | ++ peer->check_index); |
| 38 | ++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
| 39 | ++ continue; |
| 40 | ++ } |
| 41 | ++#endif |
| 42 | + if (peer->server.len != server->len |
| 43 | + || ngx_strncmp(peer->server.data, server->data, server->len) |
| 44 | + != 0) |
1 | 45 | diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
|
2 | 46 | index 148d73a..913e395 100644
|
3 | 47 | --- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
|
|
0 commit comments