[3.0] 0938a2e Drop the body of hit-for-pass objects once we have delivered them to the original requester.
Tollef Fog Heen
tfheen at varnish-cache.org
Thu May 24 14:47:42 CEST 2012
commit 0938a2ed1903a397d02640a60f4d977baf818267
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Feb 27 08:31:41 2012 +0000
Drop the body of hit-for-pass objects once we have delivered them to
the original requester.
Submitted by: DocWilco
diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index b2b9a45..bf08fb0 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -276,6 +276,13 @@ cnt_deliver(struct sess *sp)
RES_WriteObj(sp);
+ /* No point in saving the body if it is hit-for-pass */
+ if (sp->obj->objcore != NULL) {
+ CHECK_OBJ_NOTNULL(sp->obj->objcore, OBJCORE_MAGIC);
+ if (sp->obj->objcore->flags & OC_F_PASS)
+ STV_Freestore(sp->obj);
+ }
+
assert(WRW_IsReleased(sp->wrk));
assert(sp->wrk->wrw.ciov == sp->wrk->wrw.siov);
(void)HSH_Deref(sp->wrk, NULL, &sp->obj);
More information about the varnish-commit
mailing list