[3.0] ec3097a Reset the "built vary spec" (also) if we came back from the waiting list, otherwise it might turn into garbage.

Tollef Fog Heen tfheen at varnish-cache.org
Wed Sep 21 14:28:14 CEST 2011


commit ec3097a5d70b54fffe594cea7f3267ae7c56063b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Sep 1 07:55:46 2011 +0000

    Reset the "built vary spec" (also) if we came back from the waiting
    list, otherwise it might turn into garbage.
    
    Fixes	#994
    Fixes	#1001

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index df9941c..0f69861 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -1080,10 +1080,12 @@ cnt_lookup(struct sess *sp)
 		AZ(sp->vary_l);
 		AZ(sp->vary_e);
 		(void)WS_Reserve(sp->ws, 0);
-		sp->vary_b = (void*)sp->ws->f;
-		sp->vary_e = (void*)sp->ws->r;
-		sp->vary_b[2] = '\0';
+	} else {
+		AN(sp->ws->r);
 	}
+	sp->vary_b = (void*)sp->ws->f;
+	sp->vary_e = (void*)sp->ws->r;
+	sp->vary_b[2] = '\0';
 
 	oc = HSH_Lookup(sp, &oh);
 



More information about the varnish-commit mailing list