diff options
author | Ruslan Ermilov <ru@nginx.com> | 2017-05-15 17:16:32 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2017-05-15 17:16:32 +0300 |
commit | b313bc4bd3a61fe8bf9fccbf14ef75ddbd25160b (patch) | |
tree | dfb824d232f22f05547c6bc40754089ed62118b0 /src/http/modules/ngx_http_access_module.c | |
parent | 99611988792cbc6a3355bb169bbc797bb6d6310f (diff) | |
download | nginx-b313bc4bd3a61fe8bf9fccbf14ef75ddbd25160b.tar.gz nginx-b313bc4bd3a61fe8bf9fccbf14ef75ddbd25160b.zip |
Access: simplified rule parser code.
Diffstat (limited to 'src/http/modules/ngx_http_access_module.c')
-rw-r--r-- | src/http/modules/ngx_http_access_module.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/http/modules/ngx_http_access_module.c b/src/http/modules/ngx_http_access_module.c index c553e4610..7355de9e7 100644 --- a/src/http/modules/ngx_http_access_module.c +++ b/src/http/modules/ngx_http_access_module.c @@ -309,27 +309,21 @@ ngx_http_access_rule(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_http_access_rule_un_t *rule_un; #endif + all = 0; ngx_memzero(&cidr, sizeof(ngx_cidr_t)); value = cf->args->elts; - all = (value[1].len == 3 && ngx_strcmp(value[1].data, "all") == 0); - - if (!all) { + if (value[1].len == 3 && ngx_strcmp(value[1].data, "all") == 0) { + all = 1; #if (NGX_HAVE_UNIX_DOMAIN) + } else if (value[1].len == 5 && ngx_strcmp(value[1].data, "unix:") == 0) { + cidr.family = AF_UNIX; +#endif - if (value[1].len == 5 && ngx_strcmp(value[1].data, "unix:") == 0) { - cidr.family = AF_UNIX; - rc = NGX_OK; - - } else { - rc = ngx_ptocidr(&value[1], &cidr); - } - -#else + } else { rc = ngx_ptocidr(&value[1], &cidr); -#endif if (rc == NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |