[3.0] 24e4a2f Cap the TTL (to param "shortlived") when we use the Transient storage to avoid dropping an object on out of storage conditions.

Tollef Fog Heen tfheen at varnish-cache.org
Wed Aug 17 11:26:06 CEST 2011


commit 24e4a2f51a329563188dc5c4cbb58337f0d09aef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Aug 2 09:48:16 2011 +0000

    Cap the TTL (to param "shortlived") when we use the Transient storage
    to avoid dropping an object on out of storage conditions.
    
    I belive this...
    
    Fixes	#953
    
    Otherwise please reopen.

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index 23ad92f..4bac471 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -754,7 +754,8 @@ cnt_fetchbody(struct sess *sp)
 		 */
 		sp->obj = STV_NewObject(sp, TRANSIENT_STORAGE, l,
 		    &sp->wrk->exp, nhttp);
-		sp->wrk->exp.ttl = params->shortlived;
+		if (sp->wrk->exp.ttl > params->shortlived)
+			sp->wrk->exp.ttl = params->shortlived;
 	}
 	if (sp->obj == NULL) {
 		sp->err_code = 503;



More information about the varnish-commit mailing list