[master] 6405cc218 Remove VDP_push's "bottom" argument, we always build VDP stacks from the top down.

Poul-Henning Kamp phk at FreeBSD.org
Fri Oct 12 11:47:09 UTC 2018


commit 6405cc218e83fc7e607e398c756abd41e4406b48
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Oct 12 11:45:57 2018 +0000

    Remove VDP_push's "bottom" argument, we always build VDP stacks
    from the top down.

diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index aa6a9a7ca..0e7602a10 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -74,7 +74,7 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
 }
 
 int
-VDP_push(struct req *req, const struct vdp *vdp, void *priv, int bottom)
+VDP_Push(struct req *req, const struct vdp *vdp, void *priv)
 {
 	struct vdp_entry *vdpe;
 	struct vdp_ctx *vdc;
@@ -100,10 +100,7 @@ VDP_push(struct req *req, const struct vdp *vdp, void *priv, int bottom)
 	INIT_OBJ(vdpe, VDP_ENTRY_MAGIC);
 	vdpe->vdp = vdp;
 	vdpe->priv = priv;
-	if (bottom)
-		VTAILQ_INSERT_TAIL(&vdc->vdp, vdpe, list);
-	else
-		VTAILQ_INSERT_HEAD(&vdc->vdp, vdpe, list);
+	VTAILQ_INSERT_TAIL(&vdc->vdp, vdpe, list);
 	vdc->nxt = VTAILQ_FIRST(&vdc->vdp);
 
 	AZ(vdc->retval);
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 312c2a986..067e64470 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -833,9 +833,9 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody)
 		ved_stripgzip(req, boc);
 	} else {
 		if (ecx->isgzip && !i)
-			(void)VDP_push(req, &ved_vdp_pgz, ecx, 1);
+			(void)VDP_Push(req, &ved_vdp_pgz, ecx);
 		else
-			(void)VDP_push(req, &ved_ved, ecx->preq, 1);
+			(void)VDP_Push(req, &ved_ved, ecx->preq);
 		(void)VDP_DeliverObj(req);
 		(void)VDP_bytes(req, VDP_FLUSH, NULL, 0);
 	}
diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index 9c317ae95..79097f99d 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -129,6 +129,6 @@ struct vdp_ctx {
 };
 
 int VDP_bytes(struct req *, enum vdp_action act, const void *ptr, ssize_t len);
-int VDP_push(struct req *, const struct vdp *, void *priv, int bottom);
+int VDP_Push(struct req *, const struct vdp *, void *priv);
 void VRT_AddVDP(VRT_CTX, const struct vdp *);
 void VRT_RemoveVDP(VRT_CTX, const struct vdp *);
diff --git a/bin/varnishd/cache/cache_range.c b/bin/varnishd/cache/cache_range.c
index c6cf1fd3c..8bcec96d4 100644
--- a/bin/varnishd/cache/cache_range.c
+++ b/bin/varnishd/cache/cache_range.c
@@ -181,7 +181,7 @@ vrg_dorange(struct req *req, const char *r)
 	vrg_priv->range_off = 0;
 	vrg_priv->range_low = low;
 	vrg_priv->range_high = high + 1;
-	if (VDP_push(req, &vrg_vdp, vrg_priv, 1))
+	if (VDP_Push(req, &vrg_vdp, vrg_priv))
 		return ("WS too small");
 	http_PutResponse(req->resp, "HTTP/1.1", 206, NULL);
 	return (NULL);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index b6b45dcb7..ee589d19e 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -379,13 +379,13 @@ cnt_transmit(struct worker *wrk, struct req *req)
 	if (sendbody >= 0) {
 		if (!req->disable_esi && req->resp_len != 0 &&
 		    ObjHasAttr(wrk, req->objcore, OA_ESIDATA) &&
-		    VDP_push(req, &VDP_esi, NULL, 0) < 0)
+		    VDP_Push(req, &VDP_esi, NULL) < 0)
 			err++;
 
 		if (cache_param->http_gzip_support &&
 		    ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED) &&
 		    !RFC2616_Req_Gzip(req->http) &&
-		    VDP_push(req, &VDP_gunzip, NULL, 1) < 0)
+		    VDP_Push(req, &VDP_gunzip, NULL) < 0)
 			err++;
 
 		if (cache_param->http_range_support &&
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 06764c67f..c075dd908 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -126,7 +126,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
 	if (req->resp_len == 0)
 		sendbody = 0;
 
-	if (sendbody && VDP_push(req, &v1d_vdp, NULL, 1)) {
+	if (sendbody && VDP_Push(req, &v1d_vdp, NULL)) {
 		v1d_error(req, "workspace_thread overflow");
 		AZ(req->wrk->v1l);
 		return;
diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c
index f636e5285..446cdaa6e 100644
--- a/bin/varnishd/http2/cache_http2_deliver.c
+++ b/bin/varnishd/http2/cache_http2_deliver.c
@@ -301,7 +301,7 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody)
 
 	/* XXX someone into H2 please add appropriate error handling */
 	if (sendbody) {
-		if (!VDP_push(req, &h2_vdp, NULL, 1))
+		if (!VDP_Push(req, &h2_vdp, NULL))
 			(void)VDP_DeliverObj(req);
 	}
 


More information about the varnish-commit mailing list