Skip to content

Commit

Permalink
Merge branch 'develop' into websocket
Browse files Browse the repository at this point in the history
Conflicts:
	ngx_tcp_upstream.c
  • Loading branch information
yaoweibin committed Oct 24, 2011
2 parents a916a9e + b5be1fe commit f0245d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ngx_tcp_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ static ngx_command_t ngx_tcp_upstream_commands[] = {
NGX_TCP_UPS_CONF|NGX_CONF_1MORE,
ngx_conf_set_bitmask_slot,
NGX_TCP_SRV_CONF_OFFSET,
offsetof(ngx_tcp_upstream_srv_conf_t, status_alive),
offsetof(ngx_tcp_upstream_srv_conf_t, code.status_alive),
&ngx_check_http_expect_alive_masks },

{ ngx_string("check_smtp_expect_alive"),
NGX_TCP_UPS_CONF|NGX_CONF_1MORE,
ngx_conf_set_bitmask_slot,
NGX_TCP_SRV_CONF_OFFSET,
offsetof(ngx_tcp_upstream_srv_conf_t, status_alive),
offsetof(ngx_tcp_upstream_srv_conf_t, code.status_alive),
&ngx_check_smtp_expect_alive_masks },

{ ngx_string("check_shm_size"),
Expand Down Expand Up @@ -658,7 +658,7 @@ ngx_tcp_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
uscf->line = cf->conf_file->line;
uscf->port = u->port;
uscf->default_port = u->default_port;
uscf->status_alive = 0;
uscf->code.status_alive = 0;

if (u->naddrs == 1) {
uscf->servers = ngx_array_create(cf->pool, 1,
Expand Down
2 changes: 1 addition & 1 deletion ngx_tcp_upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct ngx_tcp_upstream_srv_conf_s {
union {
ngx_uint_t return_code;
ngx_uint_t status_alive;
};
} code;
};


Expand Down
12 changes: 6 additions & 6 deletions ngx_tcp_upstream_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,12 @@ ngx_tcp_check_http_parse(ngx_tcp_check_peer_conf_t *peer_conf)

ngx_log_debug2(NGX_LOG_DEBUG_TCP, ngx_cycle->log, 0,
"http_parse: hp->status_code_n: %d, conf: %d",
hp->status_code_n, uscf->status_alive);
hp->status_code_n, uscf->code.status_alive);

if (hp->status_code_n == 0) {
return NGX_AGAIN;
}
else if (hp->status_code_n & uscf->status_alive) {
else if (hp->status_code_n & uscf->code.status_alive) {
return NGX_OK;
}
else {
Expand Down Expand Up @@ -1068,12 +1068,12 @@ ngx_tcp_check_smtp_parse(ngx_tcp_check_peer_conf_t *peer_conf)

ngx_log_debug2(NGX_LOG_DEBUG_TCP, ngx_cycle->log, 0,
"smtp_parse: sp->hello_reply_code: %d, conf: %d",
sp->hello_reply_code, uscf->status_alive);
sp->hello_reply_code, uscf->code.status_alive);

if (sp->hello_reply_code == 0) {
return NGX_AGAIN;
}
else if (sp->hello_reply_code & uscf->status_alive) {
else if (sp->hello_reply_code & uscf->code.status_alive) {
return NGX_OK;
}
else {
Expand Down Expand Up @@ -1605,8 +1605,8 @@ ngx_tcp_upstream_init_check_conf(ngx_tcp_upstream_srv_conf_t *uscf)
uscf->send.len = cf->default_send.len;
}

if (uscf->status_alive == 0) {
uscf->status_alive = cf->default_status_alive;
if (uscf->code.status_alive == 0) {
uscf->code.status_alive = cf->default_status_alive;
}
}

Expand Down

0 comments on commit f0245d9

Please sign in to comment.