aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index a8c33f1c5..88d58e6fe 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2832,16 +2832,16 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_core_srv_conf_t *prev = parent;
ngx_http_core_srv_conf_t *conf = child;
- ngx_http_listen_t ls;
struct sockaddr_in *sin;
+ ngx_http_listen_opt_t lsopt;
ngx_http_server_name_t *sn;
/* TODO: it does not merge, it inits only */
if (!conf->listen) {
- ngx_memzero(&ls, sizeof(ngx_http_listen_t));
+ ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
- sin = (struct sockaddr_in *) &ls.sockaddr;
+ sin = (struct sockaddr_in *) &lsopt.sockaddr;
sin->sin_family = AF_INET;
#if (NGX_WIN32)
@@ -2851,17 +2851,17 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
#endif
sin->sin_addr.s_addr = INADDR_ANY;
- ls.socklen = sizeof(struct sockaddr_in);
+ lsopt.socklen = sizeof(struct sockaddr_in);
- ls.opt.backlog = NGX_LISTEN_BACKLOG;
- ls.opt.rcvbuf = -1;
- ls.opt.sndbuf = -1;
- ls.opt.wildcard = 1;
+ lsopt.backlog = NGX_LISTEN_BACKLOG;
+ lsopt.rcvbuf = -1;
+ lsopt.sndbuf = -1;
+ lsopt.wildcard = 1;
- (void) ngx_sock_ntop((struct sockaddr *) &ls.sockaddr, ls.opt.addr,
+ (void) ngx_sock_ntop((struct sockaddr *) &lsopt.sockaddr, lsopt.addr,
NGX_SOCKADDR_STRLEN, 1);
- if (ngx_http_add_listen(cf, conf, &ls) == NGX_OK) {
+ if (ngx_http_add_listen(cf, conf, &lsopt) == NGX_OK) {
return NGX_CONF_OK;
}
}
@@ -3266,10 +3266,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_core_srv_conf_t *cscf = conf;
- ngx_str_t *value, size;
- ngx_url_t u;
- ngx_uint_t n;
- ngx_http_listen_t ls;
+ ngx_str_t *value, size;
+ ngx_url_t u;
+ ngx_uint_t n;
+ ngx_http_listen_opt_t lsopt;
cscf->listen = 1;
@@ -3291,21 +3291,21 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- ngx_memzero(&ls, sizeof(ngx_http_listen_t));
+ ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
- ngx_memcpy(ls.sockaddr, u.sockaddr, u.socklen);
+ ngx_memcpy(lsopt.sockaddr, u.sockaddr, u.socklen);
- ls.socklen = u.socklen;
- ls.opt.backlog = NGX_LISTEN_BACKLOG;
- ls.opt.rcvbuf = -1;
- ls.opt.sndbuf = -1;
- ls.opt.wildcard = u.wildcard;
+ lsopt.socklen = u.socklen;
+ lsopt.backlog = NGX_LISTEN_BACKLOG;
+ lsopt.rcvbuf = -1;
+ lsopt.sndbuf = -1;
+ lsopt.wildcard = u.wildcard;
- (void) ngx_sock_ntop((struct sockaddr *) &ls.sockaddr, ls.opt.addr,
+ (void) ngx_sock_ntop((struct sockaddr *) &lsopt.sockaddr, lsopt.addr,
NGX_SOCKADDR_STRLEN, 1);
if (cf->args->nelts > 2 && ngx_strcmp(value[2].data, "default") == 0) {
- ls.opt.default_server = 1;
+ lsopt.default_server = 1;
n = 3;
} else {
@@ -3314,7 +3314,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
for ( /* void */ ; n < cf->args->nelts; n++) {
- if (ls.opt.default_server == 0) {
+ if (lsopt.default_server == 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"%V\" parameter can be specified for "
"the default \"listen\" directive only",
@@ -3323,15 +3323,15 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
if (ngx_strcmp(value[n].data, "bind") == 0) {
- ls.opt.bind = 1;
+ lsopt.bind = 1;
continue;
}
if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
- ls.opt.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
- ls.opt.bind = 1;
+ lsopt.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
+ lsopt.bind = 1;
- if (ls.opt.backlog == NGX_ERROR || ls.opt.backlog == 0) {
+ if (lsopt.backlog == NGX_ERROR || lsopt.backlog == 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid backlog \"%V\"", &value[n]);
return NGX_CONF_ERROR;
@@ -3344,10 +3344,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
size.len = value[n].len - 7;
size.data = value[n].data + 7;
- ls.opt.rcvbuf = ngx_parse_size(&size);
- ls.opt.bind = 1;
+ lsopt.rcvbuf = ngx_parse_size(&size);
+ lsopt.bind = 1;
- if (ls.opt.rcvbuf == NGX_ERROR) {
+ if (lsopt.rcvbuf == NGX_ERROR) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid rcvbuf \"%V\"", &value[n]);
return NGX_CONF_ERROR;
@@ -3360,10 +3360,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
size.len = value[n].len - 7;
size.data = value[n].data + 7;
- ls.opt.sndbuf = ngx_parse_size(&size);
- ls.opt.bind = 1;
+ lsopt.sndbuf = ngx_parse_size(&size);
+ lsopt.bind = 1;
- if (ls.opt.sndbuf == NGX_ERROR) {
+ if (lsopt.sndbuf == NGX_ERROR) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid sndbuf \"%V\"", &value[n]);
return NGX_CONF_ERROR;
@@ -3374,8 +3374,8 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strncmp(value[n].data, "accept_filter=", 14) == 0) {
#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
- ls.opt.accept_filter = (char *) &value[n].data[14];
- ls.opt.bind = 1;
+ lsopt.accept_filter = (char *) &value[n].data[14];
+ lsopt.bind = 1;
#else
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"accept filters \"%V\" are not supported "
@@ -3387,8 +3387,8 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[n].data, "deferred") == 0) {
#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
- ls.opt.deferred_accept = 1;
- ls.opt.bind = 1;
+ lsopt.deferred_accept = 1;
+ lsopt.bind = 1;
#else
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"the deferred accept is not supported "
@@ -3401,15 +3401,15 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
struct sockaddr *sa;
- sa = (struct sockaddr *) ls.sockaddr;
+ sa = (struct sockaddr *) lsopt.sockaddr;
if (sa->sa_family == AF_INET6) {
if (ngx_strcmp(&value[n].data[10], "n") == 0) {
- ls.opt.ipv6only = 1;
+ lsopt.ipv6only = 1;
} else if (ngx_strcmp(&value[n].data[10], "ff") == 0) {
- ls.opt.ipv6only = 2;
+ lsopt.ipv6only = 2;
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -3418,12 +3418,12 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- ls.opt.bind = 1;
+ lsopt.bind = 1;
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"ipv6only is not supported "
- "on addr \"%s\", ignored", ls.opt.addr);
+ "on addr \"%s\", ignored", lsopt.addr);
}
continue;
@@ -3437,7 +3437,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[n].data, "ssl") == 0) {
#if (NGX_HTTP_SSL)
- ls.opt.ssl = 1;
+ lsopt.ssl = 1;
continue;
#else
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -3452,7 +3452,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- if (ngx_http_add_listen(cf, cscf, &ls) == NGX_OK) {
+ if (ngx_http_add_listen(cf, cscf, &lsopt) == NGX_OK) {
return NGX_CONF_OK;
}