comparison src/http/modules/ngx_http_access_module.c @ 454:a8424ffa495c NGINX_0_7_39

nginx 0.7.39 *) Bugfix: large response with SSI might hang, if gzipping was enabled; the bug had appeared in 0.7.28. Thanks to Artem Bokhan. *) Bugfix: a segmentation fault might occur in worker process, if short static variants are used in a "try_files" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 02 Mar 2009 00:00:00 +0300
parents 76a79816b771
children f39b9e29530d
comparison
equal deleted inserted replaced
453:9ef0e36f3cd5 454:a8424ffa495c
139 { 139 {
140 ngx_http_access_loc_conf_t *alcf = conf; 140 ngx_http_access_loc_conf_t *alcf = conf;
141 141
142 ngx_int_t rc; 142 ngx_int_t rc;
143 ngx_str_t *value; 143 ngx_str_t *value;
144 ngx_inet_cidr_t in_cidr; 144 ngx_cidr_t cidr;
145 ngx_http_access_rule_t *rule; 145 ngx_http_access_rule_t *rule;
146 146
147 if (alcf->rules == NULL) { 147 if (alcf->rules == NULL) {
148 alcf->rules = ngx_array_create(cf->pool, 4, 148 alcf->rules = ngx_array_create(cf->pool, 4,
149 sizeof(ngx_http_access_rule_t)); 149 sizeof(ngx_http_access_rule_t));
166 rule->addr = 0; 166 rule->addr = 0;
167 167
168 return NGX_CONF_OK; 168 return NGX_CONF_OK;
169 } 169 }
170 170
171 rc = ngx_ptocidr(&value[1], &in_cidr); 171 rc = ngx_ptocidr(&value[1], &cidr);
172 172
173 if (rc == NGX_ERROR) { 173 if (rc == NGX_ERROR) {
174 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"", 174 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
175 &value[1]); 175 &value[1]);
176 return NGX_CONF_ERROR; 176 return NGX_CONF_ERROR;
177 } 177 }
178 178
179 if (cidr.family != AF_INET) {
180 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
181 "\"allow\" supports IPv4 only");
182 return NGX_CONF_ERROR;
183 }
184
179 if (rc == NGX_DONE) { 185 if (rc == NGX_DONE) {
180 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, 186 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
181 "low address bits of %V are meaningless", &value[1]); 187 "low address bits of %V are meaningless", &value[1]);
182 } 188 }
183 189
184 rule->mask = in_cidr.mask; 190 rule->mask = cidr.u.in.mask;
185 rule->addr = in_cidr.addr; 191 rule->addr = cidr.u.in.addr;
186 192
187 return NGX_CONF_OK; 193 return NGX_CONF_OK;
188 } 194 }
189 195
190 196