[3.0] d6bc813 Fix ttl when backend fetches are salvaged into transient storage.

Tollef Fog Heen tfheen at varnish-cache.org
Thu May 24 14:47:45 CEST 2012


commit d6bc813c8e08d7aaa20e27d52cf330d0548c7e9b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 21 07:23:27 2012 +0000

    Fix ttl when backend fetches are salvaged into transient storage.
    
    Submitted by:	Martin
    Fixes		#1140

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index bf08fb0..23183ed 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -788,12 +788,12 @@ cnt_fetchbody(struct sess *sp)
 		 * Try to salvage the transaction by allocating a
 		 * shortlived object on Transient storage.
 		 */
-		sp->obj = STV_NewObject(sp, TRANSIENT_STORAGE, l,
-		    &sp->wrk->exp, nhttp);
 		if (sp->wrk->exp.ttl > params->shortlived)
 			sp->wrk->exp.ttl = params->shortlived;
 		sp->wrk->exp.grace = 0.0;
 		sp->wrk->exp.keep = 0.0;
+		sp->obj = STV_NewObject(sp, TRANSIENT_STORAGE, l,
+		    &sp->wrk->exp, nhttp);
 	}
 	if (sp->obj == NULL) {
 		sp->err_code = 503;



More information about the varnish-commit mailing list