[master] 99fe067 Further untangling of the VDP stack

Poul-Henning Kamp phk at FreeBSD.org
Fri Oct 24 00:15:00 CEST 2014


commit 99fe06744222e4235c2ae4971e201d1cc6653275
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Oct 23 22:14:45 2014 +0000

    Further untangling of the VDP stack

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 9c28ac3..35fdeaa 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -156,8 +156,6 @@ ved_include(struct req *preq, const char *src, const char *host)
 	}
 	AN(V1L_IsReleased(wrk));
 
-	VDP_close(req);
-
 	CNT_AcctLogCharge(wrk->stats, req);
 	VSL_End(req->vsl);
 
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 7d873ed..8d479a9 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -345,14 +345,11 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
 		if (req->esi_level == 0 && req->res_mode & RES_GUNZIP)
 			VDP_push(req, VDP_gunzip, NULL);
 		ESI_Deliver(req);
-		if (req->esi_level == 0 && req->res_mode & RES_GUNZIP)
-			VDP_pop(req, VDP_gunzip);
 	} else if (req->res_mode & RES_ESI_CHILD) {
 		if (req->gzip_resp &&
 		    !ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
 			VDP_push(req, VED_pretend_gzip, NULL);
 			ois = v1d_WriteDirObj(req);
-			VDP_pop(req, VED_pretend_gzip);
 		} else if (req->gzip_resp) {
 			if (bo != NULL)
 				VBO_waitstate(bo, BOS_FINISHED);
@@ -361,19 +358,16 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
 		    ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
 			VDP_push(req, VDP_gunzip, NULL);
 			ois = v1d_WriteDirObj(req);
-			VDP_pop(req, VDP_gunzip);
 		} else {
 			/* The toplevel will gunzip if needed */
 			ois = v1d_WriteDirObj(req);
 		}
-	} else if ((req->res_mode & RES_GUNZIP) &&
-	    ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED)) {
-		VDP_push(req, VDP_gunzip, NULL);
-		ois = v1d_WriteDirObj(req);
-		VDP_pop(req, VDP_gunzip);
 	} else {
+		if (req->res_mode & RES_GUNZIP)
+			VDP_push(req, VDP_gunzip, NULL);
 		ois = v1d_WriteDirObj(req);
 	}
+	(void)VDP_bytes(req, VDP_FLUSH, NULL, 0);
 
 	if (ois == OIS_DONE &&
 	    (req->res_mode & RES_CHUNKED) &&
@@ -383,6 +377,5 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
 	if ((V1L_FlushRelease(req->wrk) || ois != OIS_DONE) &&
 	    req->sp->fd >= 0)
 		SES_Close(req->sp, SC_REM_CLOSE);
-	if (req->esi_level == 0)
-		VDP_close(req);
+	VDP_close(req);
 }



More information about the varnish-commit mailing list