1 --- src/http/modules/ngx_http_upstream_hash_module.c.orig	2016-02-24 14:53:24 UTC
2 +++ src/http/modules/ngx_http_upstream_hash_module.c
3 @@ -9,6 +9,9 @@
4  #include <ngx_core.h>
5  #include <ngx_http.h>
6 
7 +#if (NGX_HTTP_UPSTREAM_CHECK)
8 +#include "ngx_http_upstream_check_module.h"
9 +#endif
10 
11  typedef struct {
12      uint32_t                            hash;
13 @@ -235,6 +238,15 @@ ngx_http_upstream_get_hash_peer(ngx_peer
14              goto next;
15          }
16 
17 +#if (NGX_HTTP_UPSTREAM_CHECK)
18 +        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
19 +            "get hash peer, check_index: %ui",
20 +             peer->check_index);
21 +        if (ngx_http_upstream_check_peer_down(peer->check_index)) {
22 +            goto next;
23 +        }
24 +#endif
25 +
26          if (peer->max_fails
27              && peer->fails >= peer->max_fails
28              && now - peer->checked <= peer->fail_timeout)
29 @@ -535,6 +547,15 @@ ngx_http_upstream_get_chash_peer(ngx_pee
30                  continue;
31              }
32 
33 +#if (NGX_HTTP_UPSTREAM_CHECK)
34 +            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
35 +                "get consistent_hash peer, check_index: %ui",
36 +                 peer->check_index);
37 +            if (ngx_http_upstream_check_peer_down(peer->check_index)) {
38 +                continue;
39 +            }
40 +#endif
41 +
42              if (peer->server.len != server->len
43                  || ngx_strncmp(peer->server.data, server->data, server->len)
44                     != 0)
45