[5.1] 308843a Don't attept return(pipe) on HTTP/2 requests, pass with a VSL message.

Poul-Henning Kamp phk at FreeBSD.org
Mon Apr 10 13:59:09 CEST 2017


commit 308843aaf8b67eee4a53889bca31aa319fd2f2f1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Apr 6 13:45:02 2017 +0000

    Don't attept return(pipe) on HTTP/2 requests, pass with a VSL message.

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 1320e81..cdd443f 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -864,15 +864,20 @@ cnt_recv(struct worker *wrk, struct req *req)
 		req->req_step = R_STP_LOOKUP;
 		return (REQ_FSM_MORE);
 	case VCL_RET_PIPE:
-		if (req->esi_level == 0) {
+		if (req->esi_level > 0) {
+			VSLb(req->vsl, SLT_VCL_Error,
+			    "vcl_recv{} returns pipe for ESI included object."
+			    "  Doing pass.");
+			req->req_step = R_STP_PASS;
+		} else if (req->http0->protover > 11) {
+			VSLb(req->vsl, SLT_VCL_Error,
+			    "vcl_recv{} returns pipe for HTTP/2 request."
+			    "  Doing pass.");
+			req->req_step = R_STP_PASS;
+		} else {
 			req->req_step = R_STP_PIPE;
-			return (REQ_FSM_MORE);
 		}
-		VSLb(req->vsl, SLT_VCL_Error,
-		    "vcl_recv{} returns pipe for ESI included object."
-		    "  Doing pass.");
-		req->req_step = R_STP_PASS;
-		return (REQ_FSM_DONE);
+		return (REQ_FSM_MORE);
 	case VCL_RET_PASS:
 		req->req_step = R_STP_PASS;
 		return (REQ_FSM_MORE);
diff --git a/bin/varnishtest/tests/t02000.vtc b/bin/varnishtest/tests/t02000.vtc
index 6eb9ff8..3be9e17 100644
--- a/bin/varnishtest/tests/t02000.vtc
+++ b/bin/varnishtest/tests/t02000.vtc
@@ -9,7 +9,11 @@ server s1 {
 		-bodylen 10
 } -start
 
-varnish v1 -vcl+backend {} -start
+varnish v1 -vcl+backend {
+	sub vcl_recv {
+		return (pipe);
+	}
+} -start
 
 varnish v1 -cliok "param.set debug +syncvsl"
 



More information about the varnish-commit mailing list