comparison src/http/modules/ngx_http_access_module.c @ 2202:2300ab9b069e

*) refactor ngx_ptocidr() *) allow address without bitmask *) thus now ngx_http_geo_module accepts addresses without bitmask
author Igor Sysoev <igor@sysoev.ru>
date Tue, 26 Aug 2008 14:19:37 +0000
parents ba9e6e57f65d
children 2e91aecb9e57
comparison
equal deleted inserted replaced
2201:49a269b67213 2202:2300ab9b069e
164 rule->addr = 0; 164 rule->addr = 0;
165 165
166 return NGX_CONF_OK; 166 return NGX_CONF_OK;
167 } 167 }
168 168
169 rule->addr = inet_addr((char *) value[1].data);
170
171 if (rule->addr != INADDR_NONE) {
172 rule->mask = 0xffffffff;
173
174 return NGX_CONF_OK;
175 }
176
177 rc = ngx_ptocidr(&value[1], &in_cidr); 169 rc = ngx_ptocidr(&value[1], &in_cidr);
178 170
179 if (rc == NGX_ERROR) { 171 if (rc == NGX_ERROR) {
180 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"", 172 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
181 &value[1]); 173 &value[1]);