]> err.no Git - varnish/commitdiff
Fix ESI documents with multiple includes.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 31 Mar 2008 21:48:33 +0000 (21:48 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 31 Mar 2008 21:48:33 +0000 (21:48 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2616 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c

index b6ee80283c8bd8fcbe3d8d225d6f299b6a7fcbd8..a1546282474fe726bf2377c06cfd8dd27da20eff 100644 (file)
@@ -169,6 +169,12 @@ cnt_deliver(struct sess *sp)
                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 @@ cnt_done(struct sess *sp)
                                         * 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 @@ cnt_recv(struct sess *sp)
        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 @@ cnt_start(struct sess *sp)
 
        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;