[master] 213939a Don't issue Unset VSL records for the three top-line fields.

Poul-Henning Kamp phk at FreeBSD.org
Wed Mar 1 00:31:05 CET 2017


commit 213939a3cf03172b896e4705dcec2e486da5bc5a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 28 23:30:01 2017 +0000

    Don't issue Unset VSL records for the three top-line fields.

diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index c200e24..0c1487d 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -798,7 +798,8 @@ http_ForceField(struct http *to, unsigned n, const char *t)
 	if (to->hd[n].b == NULL || strcmp(to->hd[n].b, t)) {
 		i = (HTTP_HDR_UNSET - HTTP_HDR_METHOD);
 		i += to->logtag;
-		VSLbt(to->vsl, (enum VSL_tag_e)i, to->hd[n]);
+		if (n >= HTTP_HDR_FIRST)
+			VSLbt(to->vsl, (enum VSL_tag_e)i, to->hd[n]);
 		http_SetH(to, n, t);
 	}
 }
diff --git a/bin/varnishtest/tests/r01662.vtc b/bin/varnishtest/tests/r01662.vtc
index 84d4800..d8eb01c 100644
--- a/bin/varnishtest/tests/r01662.vtc
+++ b/bin/varnishtest/tests/r01662.vtc
@@ -13,9 +13,7 @@ varnish v1 -vcl+backend {
 logexpect l1 -v v1 -g request {
 	expect * 1001	ReqMethod	"HEAD"
 	expect * =	ReqProtocol	"HTTP/1.0"
-	expect * 1002	BereqUnset	"HEAD"
-	expect 0 =	BereqMethod	"GET"
-	expect * =	BereqUnset	"HTTP/1.0"
+	expect * 1002	BereqMethod	"GET"
 	expect 0 =	BereqProtocol	"HTTP/1.1"
 } -start
 



More information about the varnish-commit mailing list