Permalink
Browse files

Support new healthcheck API

New API includes a log pointer
  • Loading branch information...
1 parent 470a016 commit 8243c8127af24b3a59f329800607aa427109afb5 jlindamood committed Mar 19, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 ngx_http_upstream_hash_module.c
@@ -57,7 +57,8 @@ static char *ngx_http_upstream_hash_again(ngx_conf_t *cf, ngx_command_t *cmd,
static ngx_int_t ngx_http_upstream_init_hash(ngx_conf_t *cf,
ngx_http_upstream_srv_conf_t *us);
static ngx_uint_t ngx_http_upstream_hash_crc32(u_char *keydata, size_t keylen);
-static ngx_int_t ngx_http_upstream_is_down(ngx_http_upstream_hash_peer_t *peer);
+static ngx_int_t ngx_http_upstream_is_down(ngx_http_upstream_hash_peer_t *peer,
+ ngx_log_t *log);
static ngx_command_t ngx_http_upstream_hash_commands[] = {
{ ngx_string("hash"),
@@ -284,13 +285,14 @@ static void ngx_http_upstream_hash_next_peer(ngx_http_upstream_hash_peer_data_t
// the current peer isn't marked down
} while (--(*tries) && (
(uhpd->tried[ngx_bitvector_index(current)] & ngx_bitvector_bit(current))
- || ngx_http_upstream_is_down(&uhpd->peers->peer[current])));
+ || ngx_http_upstream_is_down(&uhpd->peers->peer[current], log)));
}
-static ngx_int_t ngx_http_upstream_is_down(ngx_http_upstream_hash_peer_t *peer) {
+static ngx_int_t ngx_http_upstream_is_down(ngx_http_upstream_hash_peer_t *peer,
+ ngx_log_t *log) {
return peer->down
#if (NGX_HTTP_HEALTHCHECK)
- || ngx_http_healthcheck_is_down(peer->health_index)
+ || ngx_http_healthcheck_is_down(peer->health_index, log)
#endif
;
}

0 comments on commit 8243c81

Please sign in to comment.