comparison src/http/modules/ngx_http_realip_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
280 { 280 {
281 ngx_http_realip_loc_conf_t *rlcf = conf; 281 ngx_http_realip_loc_conf_t *rlcf = conf;
282 282
283 ngx_int_t rc; 283 ngx_int_t rc;
284 ngx_str_t *value; 284 ngx_str_t *value;
285 ngx_inet_cidr_t in_cidr; 285 ngx_cidr_t cidr;
286 ngx_http_realip_from_t *from; 286 ngx_http_realip_from_t *from;
287 287
288 if (rlcf->from == NULL) { 288 if (rlcf->from == NULL) {
289 rlcf->from = ngx_array_create(cf->pool, 2, 289 rlcf->from = ngx_array_create(cf->pool, 2,
290 sizeof(ngx_http_realip_from_t)); 290 sizeof(ngx_http_realip_from_t));
298 return NGX_CONF_ERROR; 298 return NGX_CONF_ERROR;
299 } 299 }
300 300
301 value = cf->args->elts; 301 value = cf->args->elts;
302 302
303 rc = ngx_ptocidr(&value[1], &in_cidr); 303 rc = ngx_ptocidr(&value[1], &cidr);
304 304
305 if (rc == NGX_ERROR) { 305 if (rc == NGX_ERROR) {
306 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"", 306 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
307 &value[1]); 307 &value[1]);
308 return NGX_CONF_ERROR; 308 return NGX_CONF_ERROR;
309 } 309 }
310 310
311 if (cidr.family != AF_INET) {
312 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
313 "\"realip_from\" supports IPv4 only");
314 return NGX_CONF_ERROR;
315 }
316
311 if (rc == NGX_DONE) { 317 if (rc == NGX_DONE) {
312 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, 318 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
313 "low address bits of %V are meaningless", &value[1]); 319 "low address bits of %V are meaningless", &value[1]);
314 } 320 }
315 321
316 from->mask = in_cidr.mask; 322 from->mask = cidr.u.in.mask;
317 from->addr = in_cidr.addr; 323 from->addr = cidr.u.in.addr;
318 324
319 return NGX_CONF_OK; 325 return NGX_CONF_OK;
320 } 326 }
321 327
322 328