mirror of
https://github.com/nginx/nginx.git
synced 2026-09-04 12:28:20 +00:00
HTTP/2: precalculate hash for "Cookie".
There is no need to calculate hashes of static strings at runtime. The ngx_hash() macro can be used to do it during compilation instead, similarly to how it is done in ngx_http_proxy_module.c for "Server" and "Date" headers.
This commit is contained in:
parent
89661c0e7d
commit
9e2cd6282f
1 changed files with 2 additions and 1 deletions
|
|
@ -3698,7 +3698,8 @@ ngx_http_v2_construct_cookie_header(ngx_http_request_t *r)
|
|||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
h->hash = ngx_hash_key(cookie.data, cookie.len);
|
||||
h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
|
||||
ngx_hash('c', 'o'), 'o'), 'k'), 'i'), 'e');
|
||||
|
||||
h->key.len = cookie.len;
|
||||
h->key.data = cookie.data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue