comparison src/http/modules/ngx_http_proxy_module.c @ 2135:8c6521eedf84

ngx_strlow()
author Igor Sysoev <igor@sysoev.ru>
date Mon, 04 Aug 2008 10:07:00 +0000
parents 5657037448d1
children 274c0f3ea600
comparison
equal deleted inserted replaced
2134:13652cba8633 2135:8c6521eedf84
1194 1194
1195 static ngx_int_t 1195 static ngx_int_t
1196 ngx_http_proxy_process_header(ngx_http_request_t *r) 1196 ngx_http_proxy_process_header(ngx_http_request_t *r)
1197 { 1197 {
1198 ngx_int_t rc; 1198 ngx_int_t rc;
1199 ngx_uint_t i;
1200 ngx_table_elt_t *h; 1199 ngx_table_elt_t *h;
1201 ngx_http_upstream_header_t *hh; 1200 ngx_http_upstream_header_t *hh;
1202 ngx_http_upstream_main_conf_t *umcf; 1201 ngx_http_upstream_main_conf_t *umcf;
1203 1202
1204 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); 1203 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
1235 1234
1236 if (h->key.len == r->lowcase_index) { 1235 if (h->key.len == r->lowcase_index) {
1237 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len); 1236 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
1238 1237
1239 } else { 1238 } else {
1240 for (i = 0; i < h->key.len; i++) { 1239 ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
1241 h->lowcase_key[i] = ngx_tolower(h->key.data[i]);
1242 }
1243 } 1240 }
1244 1241
1245 hh = ngx_hash_find(&umcf->headers_in_hash, h->hash, 1242 hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
1246 h->lowcase_key, h->key.len); 1243 h->lowcase_key, h->key.len);
1247 1244