comparison src/event/ngx_event.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 90312b616162
children a472d954c534
comparison
equal deleted inserted replaced
2201:49a269b67213 2202:2300ab9b069e
1049 dc = ngx_array_push(&ecf->debug_connection); 1049 dc = ngx_array_push(&ecf->debug_connection);
1050 if (dc == NULL) { 1050 if (dc == NULL) {
1051 return NGX_CONF_ERROR; 1051 return NGX_CONF_ERROR;
1052 } 1052 }
1053 1053
1054 dc->addr = inet_addr((char *) value[1].data);
1055
1056 if (dc->addr != INADDR_NONE) {
1057 dc->mask = 0xffffffff;
1058 return NGX_CONF_OK;
1059 }
1060
1061 rc = ngx_ptocidr(&value[1], &in_cidr); 1054 rc = ngx_ptocidr(&value[1], &in_cidr);
1062 1055
1063 if (rc == NGX_DONE) { 1056 if (rc == NGX_DONE) {
1064 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, 1057 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
1065 "low address bits of %V are meaningless", &value[1]); 1058 "low address bits of %V are meaningless", &value[1]);