Skip to content

Commit

Permalink
condfetch: Check stale_oc bans before and after revalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
dridi committed Mar 15, 2024
1 parent 44827f5 commit b452cdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/varnishd/cache/cache_fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
}
http_ForceField(bo->bereq0, HTTP_HDR_PROTO, "HTTP/1.1");

if (bo->stale_oc != NULL)
HSH_CheckBans(wrk, bo->stale_oc);

if (bo->stale_oc != NULL && !(bo->stale_oc->flags & OC_F_DYING) &&
ObjCheckFlag(bo->wrk, bo->stale_oc, OF_IMSCAND) &&
(bo->stale_oc->boc != NULL || ObjGetLen(wrk, bo->stale_oc) != 0)) {
Expand Down Expand Up @@ -835,6 +838,8 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
stale_oc = bo->stale_oc;
CHECK_OBJ_NOTNULL(stale_oc, OBJCORE_MAGIC);

HSH_CheckBans(wrk, stale_oc);

if (stale_oc->flags & OC_F_DYING) {
(void)VFP_Error(bo->vfc, "Template object invalidated");
vbf_cleanup(bo);
Expand Down

0 comments on commit b452cdb

Please sign in to comment.