comparison src/http/modules/ngx_http_referer_module.c @ 150:50bd986c5d63 NGINX_0_3_22

nginx 0.3.22 *) Feature: the ngx_http_perl_module supports the $r->args and $r->unescape methods. *) Feature: the method $r->query_string of ngx_http_perl_module was canceled. *) Bugfix: segmentation fault was occurred if the "none" or "blocked" values was specified in the "valid_referers" directive; bug appeared in 0.3.18.
author Igor Sysoev <http://sysoev.ru>
date Tue, 17 Jan 2006 00:00:00 +0300
parents ea622d8acb38
children 396dbbc06dd7
comparison
equal deleted inserted replaced
149:cec6fdbfe9da 150:50bd986c5d63
88 ngx_http_referer_conf_t *rlcf; 88 ngx_http_referer_conf_t *rlcf;
89 u_char buf[256]; 89 u_char buf[256];
90 90
91 rlcf = ngx_http_get_module_loc_conf(r, ngx_http_referer_module); 91 rlcf = ngx_http_get_module_loc_conf(r, ngx_http_referer_module);
92 92
93 if (rlcf->hash.buckets == NULL 93 if (rlcf->hash.buckets == NULL && rlcf->dns_wildcards == NULL) {
94 && rlcf->dns_wildcards == NULL
95 && rlcf->dns_wildcards->hash.buckets == NULL)
96 {
97 goto valid; 94 goto valid;
98 } 95 }
99 96
100 if (r->headers_in.referer == NULL) { 97 if (r->headers_in.referer == NULL) {
101 if (rlcf->no_referer) { 98 if (rlcf->no_referer) {
143 if (uri) { 140 if (uri) {
144 goto uri; 141 goto uri;
145 } 142 }
146 } 143 }
147 144
148 if (rlcf->dns_wildcards && rlcf->dns_wildcards->hash.buckets) { 145 if (rlcf->dns_wildcards) {
149 uri = ngx_hash_find_wildcard(rlcf->dns_wildcards, buf, len); 146 uri = ngx_hash_find_wildcard(rlcf->dns_wildcards, buf, len);
150 if (uri) { 147 if (uri) {
151 goto uri; 148 goto uri;
152 } 149 }
153 } 150 }