Skip to content

Commit c294284

Browse files
TimWollawlallemand
authored andcommitted
CLEANUP: Reduce scope of hdr_age in http_action_store_cache()
This is only required to process the `age` header.
1 parent e2fff10 commit c294284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,6 @@ static void set_secondary_key_encoding(struct htx *htx, char *secondary_key)
977977
enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px,
978978
struct session *sess, struct stream *s, int flags)
979979
{
980-
long long hdr_age;
981980
int effective_maxage = 0;
982981
int true_maxage = 0;
983982
struct http_txn *txn = s->txn;
@@ -1147,6 +1146,7 @@ enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px,
11471146

11481147
ctx.blk = NULL;
11491148
if (http_find_header(htx, ist("Age"), &ctx, 0)) {
1149+
long long hdr_age;
11501150
if (!strl2llrc(ctx.value.ptr, ctx.value.len, &hdr_age) && hdr_age > 0) {
11511151
if (unlikely(hdr_age > CACHE_ENTRY_MAX_AGE))
11521152
hdr_age = CACHE_ENTRY_MAX_AGE;

0 commit comments

Comments
 (0)