[master] 0350510 Enable Range: for ESI requests
Poul-Henning Kamp
phk at FreeBSD.org
Mon Oct 27 09:54:11 CET 2014
commit 03505109dffc5bcb8d9d3d8035e06f2bfa05c152
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Oct 27 08:54:00 2014 +0000
Enable Range: for ESI requests
diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index 86c9889..65f90c9 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -70,8 +70,8 @@ VDP_push(struct req *req, vdp_bytes *func, void *priv)
AZ(vdp->func(req, VDP_INIT, &vdp->priv, NULL, 0));
}
-void
-VDP_pop(struct req *req, vdp_bytes *func)
+static void
+vdp_pop(struct req *req, vdp_bytes *func)
{
struct vdp_entry *vdp;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
@@ -91,5 +91,5 @@ VDP_close(struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
while (!VTAILQ_EMPTY(&req->vdp))
- VDP_pop(req, VTAILQ_FIRST(&req->vdp)->func);
+ vdp_pop(req, VTAILQ_FIRST(&req->vdp)->func);
}
diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index fce1c09..87f240a 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -107,7 +107,6 @@ struct vdp_entry {
int VDP_bytes(struct req *, enum vdp_action act, const void *ptr, ssize_t len);
void VDP_push(struct req *, vdp_bytes *func, void *priv);
-void VDP_pop(struct req *, vdp_bytes *func);
void VDP_close(struct req *req);
vdp_bytes VDP_gunzip;
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 746f129..4122672 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -318,7 +318,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
if (
req->wantbody &&
- !(req->res_mode & (RES_ESI|RES_ESI_CHILD)) &&
+ req->esi_level == 0 &&
cache_param->http_range_support &&
http_IsStatus(req->resp, 200)) {
http_SetHeader(req->resp, "Accept-Ranges: bytes");
diff --git a/bin/varnishtest/tests/e00003.vtc b/bin/varnishtest/tests/e00003.vtc
index 935e1f0..a8ab61a 100644
--- a/bin/varnishtest/tests/e00003.vtc
+++ b/bin/varnishtest/tests/e00003.vtc
@@ -30,7 +30,7 @@ varnish v1 -vcl+backend {
logexpect l1 -v v1 -g request {
expect 0 1001 Begin "^req .* rxreq"
- expect * = ReqAcct "^18 0 18 154 75 229$"
+ expect * = ReqAcct "^18 0 18 176 75 251$"
expect 0 = End
expect 0 1002 Begin "^bereq "
@@ -44,7 +44,7 @@ logexpect l1 -v v1 -g request {
expect * = End
expect 0 1005 Begin "^req .* rxreq"
- expect * = ReqAcct "^18 0 18 159 75 234$"
+ expect * = ReqAcct "^18 0 18 181 75 256$"
expect 0 = End
} -start
diff --git a/bin/varnishtest/tests/l00003.vtc b/bin/varnishtest/tests/l00003.vtc
index 851073c..4bbb04e 100644
--- a/bin/varnishtest/tests/l00003.vtc
+++ b/bin/varnishtest/tests/l00003.vtc
@@ -48,7 +48,7 @@ varnish v1 -vcl+backend {
logexpect l1 -v v1 -g request {
expect 0 1001 Begin "^req .* rxreq"
- expect * = ReqAcct "^18 0 18 71 15 86$"
+ expect * = ReqAcct "^18 0 18 93 15 108$"
expect 0 = End
expect * 1003 Begin "^req .* esi"
expect * = ReqAcct "^0 0 0 0 12 12$"
@@ -72,5 +72,5 @@ logexpect l1 -wait
varnish v1 -expect s_req_hdrbytes == 18
varnish v1 -expect s_req_bodybytes == 0
-varnish v1 -expect s_resp_hdrbytes == 71
+varnish v1 -expect s_resp_hdrbytes == 93
varnish v1 -expect s_resp_bodybytes == 33
More information about the varnish-commit
mailing list