Mercurial > hg > nginx
comparison src/http/modules/ngx_http_realip_module.c @ 3305:8017f9bda3f6
fix "set_real_ip_from unix:" inheritance
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 11 Nov 2009 13:41:16 +0000 |
parents | 78faaf5cea44 |
children | d620f497c50f |
comparison
equal
deleted
inserted
replaced
3304:6832c7f5e189 | 3305:8017f9bda3f6 |
---|---|
24 ngx_array_t *from; /* array of ngx_http_realip_from_t */ | 24 ngx_array_t *from; /* array of ngx_http_realip_from_t */ |
25 ngx_uint_t type; | 25 ngx_uint_t type; |
26 ngx_uint_t hash; | 26 ngx_uint_t hash; |
27 ngx_str_t header; | 27 ngx_str_t header; |
28 #if (NGX_HAVE_UNIX_DOMAIN) | 28 #if (NGX_HAVE_UNIX_DOMAIN) |
29 ngx_uint_t unixsock; /* unsigned unixsock:1; */ | 29 ngx_uint_t unixsock; /* unsigned unixsock:2; */ |
30 #endif | 30 #endif |
31 } ngx_http_realip_loc_conf_t; | 31 } ngx_http_realip_loc_conf_t; |
32 | 32 |
33 | 33 |
34 typedef struct { | 34 typedef struct { |
409 * set by ngx_pcalloc(): | 409 * set by ngx_pcalloc(): |
410 * | 410 * |
411 * conf->from = NULL; | 411 * conf->from = NULL; |
412 * conf->hash = 0; | 412 * conf->hash = 0; |
413 * conf->header = { 0, NULL }; | 413 * conf->header = { 0, NULL }; |
414 * conf->unixsock = 0; | |
415 */ | 414 */ |
416 | 415 |
417 conf->type = NGX_CONF_UNSET_UINT; | 416 conf->type = NGX_CONF_UNSET_UINT; |
417 #if (NGX_HAVE_UNIX_DOMAIN) | |
418 conf->unixsock = 2; | |
419 #endif | |
418 | 420 |
419 return conf; | 421 return conf; |
420 } | 422 } |
421 | 423 |
422 | 424 |
426 ngx_http_realip_loc_conf_t *prev = parent; | 428 ngx_http_realip_loc_conf_t *prev = parent; |
427 ngx_http_realip_loc_conf_t *conf = child; | 429 ngx_http_realip_loc_conf_t *conf = child; |
428 | 430 |
429 if (conf->from == NULL) { | 431 if (conf->from == NULL) { |
430 conf->from = prev->from; | 432 conf->from = prev->from; |
431 #if (NGX_HAVE_UNIX_DOMAIN) | 433 } |
432 conf->unixsock = prev->unixsock; | 434 |
433 #endif | 435 #if (NGX_HAVE_UNIX_DOMAIN) |
434 } | 436 if (conf->unixsock == 2) { |
437 conf->unixsock = (prev->unixsock == 2) ? 0 : prev->unixsock; | |
438 } | |
439 #endif | |
435 | 440 |
436 ngx_conf_merge_uint_value(conf->type, prev->type, NGX_HTTP_REALIP_XREALIP); | 441 ngx_conf_merge_uint_value(conf->type, prev->type, NGX_HTTP_REALIP_XREALIP); |
437 | 442 |
438 if (conf->header.len == 0) { | 443 if (conf->header.len == 0) { |
439 conf->hash = prev->hash; | 444 conf->hash = prev->hash; |