r2616 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Mar 31 23:48:33 CEST 2008


Author: phk
Date: 2008-03-31 23:48:33 +0200 (Mon, 31 Mar 2008)
New Revision: 2616

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Fix ESI documents with multiple includes.


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2008-03-31 21:48:16 UTC (rev 2615)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2008-03-31 21:48:33 UTC (rev 2616)
@@ -169,6 +169,12 @@
 		INCOMPL();
 	}
 
+	sp->director = NULL;
+	sp->backend = NULL;		/*
+					 * XXX: we may want to leave this
+					 * behind to hint directors ?
+					 */
+					
 	RES_WriteObj(sp);
 	HSH_Deref(sp->obj);
 	sp->obj = NULL;
@@ -204,7 +210,7 @@
 					 * behind to hint directors ?
 					 */
 					
-	if (sp->vcl != NULL) {
+	if (sp->vcl != NULL && sp->esis == 0) {
 		if (sp->wrk->vcl != NULL)
 			VCL_Rel(&sp->wrk->vcl);
 		sp->wrk->vcl = sp->vcl;
@@ -774,6 +780,11 @@
 	CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
 	AZ(sp->obj);
 
+	/* By default we use the first backend */
+	AZ(sp->director);
+	sp->director = sp->vcl->director[0];
+	CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
+
 	VCL_recv_method(sp);
 
 	sp->wantbody = (strcmp(sp->http->hd[HTTP_HDR_REQ].b, "HEAD") != 0);
@@ -854,11 +865,6 @@
 
 	sp->doclose = http_DoConnection(sp->http);
 
-	/* By default we use the first backend */
-	AZ(sp->director);
-	sp->director = sp->vcl->director[0];
-	CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
-
 	/* XXX: Handle TRACE & OPTIONS of Max-Forwards = 0 */
 
 	sp->step = STP_RECV;




More information about the varnish-commit mailing list