From: Remi Tricot-Le Breton Date: Fri, 30 Oct 2020 13:26:13 +0000 (+0100) Subject: BUG/MINOR: cache: Inverted variables in http_calc_maxage function X-Git-Tag: v2.3-dev9~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c2db71326addbcf9d6c8ae4d2048247031f9e4c;p=thirdparty%2Fhaproxy.git BUG/MINOR: cache: Inverted variables in http_calc_maxage function The maxage and smaxage variables were inadvertently assigned the Cache-Control s-maxage and max-age values respectively when it should have been the other way around. This can be backported on all branches after 1.8 (included). --- diff --git a/src/cache.c b/src/cache.c index a73f2668f1..f86c96f097 100644 --- a/src/cache.c +++ b/src/cache.c @@ -495,7 +495,7 @@ int http_calc_maxage(struct stream *s, struct cache *cache) chunk_strncat(chk, value, ctx.value.len - 8 + 1); chunk_strncat(chk, "", 1); - maxage = atoi(chk->area); + smaxage = atoi(chk->area); } value = directive_value(ctx.value.ptr, ctx.value.len, "max-age", 7); @@ -504,7 +504,7 @@ int http_calc_maxage(struct stream *s, struct cache *cache) chunk_strncat(chk, value, ctx.value.len - 7 + 1); chunk_strncat(chk, "", 1); - smaxage = atoi(chk->area); + maxage = atoi(chk->area); } }