Skip to content

Commit

Permalink
update upsync_dump_path default
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokai-wang committed Jan 9, 2016
1 parent e252c6d commit 00e0b2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ upsync_dump_path
-----------
`syntax: upsync_dump_path $path`

default: /usr/local/nginx/conf/upstreams/upstream_$host.conf
default: /tmp/servers_$host.conf

context: upstream

Expand Down
6 changes: 3 additions & 3 deletions src/ngx_http_upsync_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,11 +1572,11 @@ ngx_http_upsync_init_srv_conf(ngx_conf_t *cf, void *conf, ngx_uint_t num)

if (upscf->upsync_dump_path.len == NGX_CONF_UNSET_SIZE) {
buf = ngx_pcalloc(cf->pool,
ngx_strlen("/tmp/upstream_.conf") + uscf->host.len + 1);
ngx_sprintf(buf, "/tmp/upstream_%V.conf", &uscf->host);
ngx_strlen("/tmp/servers_.conf") + uscf->host.len + 1);
ngx_sprintf(buf, "/tmp/servers_%V.conf", &uscf->host);

upscf->upsync_dump_path.data = buf;
upscf->upsync_dump_path.len = ngx_strlen("/tmp/upstream_.conf")
upscf->upsync_dump_path.len = ngx_strlen("/tmp/servers_.conf")
+ uscf->host.len;
}

Expand Down

0 comments on commit 00e0b2e

Please sign in to comment.