]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cache: store sha1 for hashing the cache key
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 23 Nov 2017 18:43:17 +0000 (19:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Nov 2017 19:20:04 +0000 (20:20 +0100)
commitf528fff46bc00426f0329b46cbf77a88c92d3f8d
tree6eae2c0b52703d0b66c288678d67e8dfe2ed6bb3
parent7fc96d5a01b85cd324faa57da7bfedbe52f96dfe
MEDIUM: cache: store sha1 for hashing the cache key

The cache was relying on the txn->uri for creating its key, which was a
big problem when there was no log activated.

This patch does a sha1 of the host + uri, and stores it in the txn.
When a object is stored, the eb32node uses the first 32 bits of the hash
as a key, and the whole hash is stored in the cache entry.

During a lookup, the truncated hash is used, and when it matches an
entry we check the real sha1.
include/types/proto_http.h
src/cache.c