Skip to content

Commit

Permalink
Rewrite miss-leading "stats" variables to "status"
Browse files Browse the repository at this point in the history
Just cosmetic but helps to understand the code.
  • Loading branch information
rs committed Aug 17, 2016
1 parent 43390f9 commit 6e9bca8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ngx_http_upstream_jdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <ngx_http.h>
#include <nginx.h>

#define NGX_JDOMAIN_STATS_DONE 0
#define NGX_JDOMAIN_STATS_WAIT 1
#define NGX_JDOMAIN_STATUS_DONE 0
#define NGX_JDOMAIN_STATUS_WAIT 1

typedef struct {
struct sockaddr sockaddr;
Expand All @@ -32,7 +32,7 @@ typedef struct {
ngx_uint_t resolved_max_ips;
ngx_uint_t resolved_num;
ngx_str_t resolved_domain;
ngx_int_t resolved_stats;
ngx_int_t resolved_status;
ngx_uint_t resolved_index;
time_t resolved_access;
time_t resolved_interval;
Expand Down Expand Up @@ -125,7 +125,7 @@ ngx_http_upstream_jdomain_init(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
us->peer.init = ngx_http_upstream_jdomain_init_peer;

urcf = ngx_http_conf_upstream_srv_conf(us, ngx_http_upstream_jdomain_module);
urcf->resolved_stats = NGX_JDOMAIN_STATS_DONE;
urcf->resolved_status = NGX_JDOMAIN_STATUS_DONE;

return NGX_OK;
}
Expand Down Expand Up @@ -180,7 +180,7 @@ ngx_http_upstream_jdomain_get_peer(ngx_peer_connection_t *pc, void *data)
pc->cached = 0;
pc->connection = NULL;

if(urcf->resolved_stats == NGX_JDOMAIN_STATS_WAIT){
if(urcf->resolved_status == NGX_JDOMAIN_STATUS_WAIT){
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
"upstream_jdomain: resolving");
goto assign;
Expand Down Expand Up @@ -217,7 +217,7 @@ ngx_http_upstream_jdomain_get_peer(ngx_peer_connection_t *pc, void *data)
ctx->data = urcf;
ctx->timeout = urpd->clcf->resolver_timeout;

urcf->resolved_stats = NGX_JDOMAIN_STATS_WAIT;
urcf->resolved_status = NGX_JDOMAIN_STATUS_WAIT;
if(ngx_resolve_name(ctx) != NGX_OK) {
ngx_log_error(NGX_LOG_ALERT, pc->log, 0,
"upstream_jdomain: resolve name \"%V\" fail", &ctx->name);
Expand Down Expand Up @@ -495,7 +495,7 @@ ngx_http_upstream_jdomain_handler(ngx_resolver_ctx_t *ctx)
ngx_resolve_name_done(ctx);

urcf->resolved_access = ngx_time();
urcf->resolved_stats = NGX_JDOMAIN_STATS_DONE;
urcf->resolved_status = NGX_JDOMAIN_STATUS_DONE;
}

#if (NGX_HTTP_SSL)
Expand Down

0 comments on commit 6e9bca8

Please sign in to comment.