# HG changeset patch # User Igor Sysoev # Date 1256199242 0 # Node ID 4872f86df71922380ddbe647e9bf49ed953a9abe # Parent f649453396f56f96b26a19d916a58bf5e667fff4 fix r3225: it overrode the listen options by default server default options diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -1209,10 +1209,15 @@ ngx_http_add_addresses(ngx_conf_t *cf, n return NGX_ERROR; } - if (lsopt->set && addr[i].opt.set) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + if (lsopt->set) { + + if (addr[i].opt.set) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "a duplicate listen options for %s", addr[i].opt.addr); - return NGX_ERROR; + return NGX_ERROR; + } + + addr[i].opt = *lsopt; } /* check the duplicate "default" server for this address:port */ @@ -1225,7 +1230,6 @@ ngx_http_add_addresses(ngx_conf_t *cf, n return NGX_ERROR; } - addr[i].opt = *lsopt; addr[i].default_server = cscf; }