Changeset 7209:3dfe9444324b in nginx


Ignore:
Timestamp:
02/15/18 16:06:22 (2 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/v2/ngx_http_v2.c

    r7208 r7209  
    36993699    }
    37003700
    3701     h->hash = ngx_hash_key(cookie.data, cookie.len);
     3701    h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
     3702                                    ngx_hash('c', 'o'), 'o'), 'k'), 'i'), 'e');
    37023703
    37033704    h->key.len = cookie.len;
Note: See TracChangeset for help on using the changeset viewer.