[experimental-ims] beb0c5b Cap the TTL (to param "shortlived") when we use the Transient storage to avoid dropping an object on out of storage conditions.

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:00:11 CEST 2011


commit beb0c5b1f4f49d711822e90ca73d69bbed683a71
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