Mercurial > hg > nginx
comparison src/http/modules/perl/nginx.xs @ 2136:7a7c9e9024dd
ngx_hash_strlow()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 Aug 2008 10:18:36 +0000 |
parents | 25add486e7aa |
children | 8564129d49b6 |
comparison
equal
deleted
inserted
replaced
2135:8c6521eedf84 | 2136:7a7c9e9024dd |
---|---|
245 lowcase_key = ngx_pnalloc(r->pool, len); | 245 lowcase_key = ngx_pnalloc(r->pool, len); |
246 if (lowcase_key == NULL) { | 246 if (lowcase_key == NULL) { |
247 XSRETURN_UNDEF; | 247 XSRETURN_UNDEF; |
248 } | 248 } |
249 | 249 |
250 hash = 0; | 250 hash = ngx_hash_strlow(lowcase_key, p, len); |
251 for (i = 0; i < len; i++) { | |
252 lowcase_key[i] = ngx_tolower(p[i]); | |
253 hash = ngx_hash(hash, lowcase_key[i]); | |
254 } | |
255 | 251 |
256 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); | 252 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); |
257 | 253 |
258 hh = ngx_hash_find(&cmcf->headers_in_hash, hash, lowcase_key, len); | 254 hh = ngx_hash_find(&cmcf->headers_in_hash, hash, lowcase_key, len); |
259 | 255 |
831 lowcase = ngx_pnalloc(r->pool, len); | 827 lowcase = ngx_pnalloc(r->pool, len); |
832 if (lowcase == NULL) { | 828 if (lowcase == NULL) { |
833 XSRETURN_UNDEF; | 829 XSRETURN_UNDEF; |
834 } | 830 } |
835 | 831 |
836 hash = 0; | 832 hash = ngx_hash_strlow(lowcase, p, len); |
837 for (i = 0; i < len; i++) { | |
838 lowcase[i] = ngx_tolower(p[i]); | |
839 hash = ngx_hash(hash, lowcase[i]); | |
840 } | |
841 | 833 |
842 var.len = len; | 834 var.len = len; |
843 var.data = lowcase; | 835 var.data = lowcase; |
844 | 836 |
845 #if (NGX_LOG_DEBUG) | 837 #if (NGX_LOG_DEBUG) |