MEDIUM: cache: Use rdlock on cache in cache_use
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 16 Nov 2023 16:38:18 +0000 (17:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 16 Nov 2023 18:35:10 +0000 (19:35 +0100)
commitbd24118212f3be6b5acfa86bcb807c62aad7f2cb
tree7b8a1647293539205cc5355c8706223ea3a049ea
parent0dfb57bbf9c5411c59b3ce06ef2f3c95deb32022
MEDIUM: cache: Use rdlock on cache in cache_use

When looking for a valid entry in the cache tree in
http_action_req_cache_use, we do not need to delete an expired entry at
once because even if an expired entry exists, since the request will be
forwarded to the server, then the expired entry will be overwritten when
the updated response is seen. We can then use a simpler rdlock during
cache_use operation.
src/cache.c