From 6a07833d478a9b969dfa8a66041fc8537ee2b8d1 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 4 Aug 2008 10:18:36 +0000 Subject: ngx_hash_strlow() --- src/http/modules/perl/nginx.xs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/http/modules/perl') diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index 6e7ad7760..fbc7f59be 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -247,11 +247,7 @@ header_in(r, key) XSRETURN_UNDEF; } - hash = 0; - for (i = 0; i < len; i++) { - lowcase_key[i] = ngx_tolower(p[i]); - hash = ngx_hash(hash, lowcase_key[i]); - } + hash = ngx_hash_strlow(lowcase_key, p, len); cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); @@ -833,11 +829,7 @@ variable(r, name, value = NULL) XSRETURN_UNDEF; } - hash = 0; - for (i = 0; i < len; i++) { - lowcase[i] = ngx_tolower(p[i]); - hash = ngx_hash(hash, lowcase[i]); - } + hash = ngx_hash_strlow(lowcase, p, len); var.len = len; var.data = lowcase; -- cgit