[4.1] 33666d6 Make -msg an alias to -reason

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Oct 13 15:51:05 CEST 2016


commit 33666d69faa26824600fa8e9525a8bc995bb028d
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Sep 21 14:54:16 2016 +0200

    Make -msg an alias to -reason
    
    When we renamed resp.msg to resp.reason to match RFC and VCL terminology
    we forgot to rename its counterpart. Instead of renaming -msg to -reason
    the former will instead become an alias of the latter. This way it can
    be applied to older branches (modulus inline documentation).

diff --git a/bin/varnishtest/tests/a00002.vtc b/bin/varnishtest/tests/a00002.vtc
index 39b8334..0429309 100644
--- a/bin/varnishtest/tests/a00002.vtc
+++ b/bin/varnishtest/tests/a00002.vtc
@@ -5,7 +5,7 @@ server s1 {
 	expect req.method == PUT
 	expect req.proto == HTTP/1.0
 	expect req.url == "/foo"
-	txresp -proto HTTP/1.2 -status 201 -msg Foo
+	txresp -proto HTTP/1.2 -status 201 -reason Foo
 }
 
 server s1 -start
diff --git a/bin/varnishtest/tests/a00003.vtc b/bin/varnishtest/tests/a00003.vtc
index 810da48..b6453a8 100644
--- a/bin/varnishtest/tests/a00003.vtc
+++ b/bin/varnishtest/tests/a00003.vtc
@@ -5,7 +5,7 @@ server s1 {
 	expect req.method == PUT
 	expect req.proto == HTTP/1.0
 	expect req.url == "/foo"
-	txresp -proto HTTP/1.2 -status 201 -msg Foo
+	txresp -proto HTTP/1.2 -status 201 -reason Foo
 }
 
 server s2 {
diff --git a/bin/varnishtest/tests/a00004.vtc b/bin/varnishtest/tests/a00004.vtc
index 85659ac..01f3e29 100644
--- a/bin/varnishtest/tests/a00004.vtc
+++ b/bin/varnishtest/tests/a00004.vtc
@@ -5,7 +5,7 @@ server s1 -repeat 2 {
 	expect req.method == PUT
 	expect req.proto == HTTP/1.0
 	expect req.url == "/foo"
-	txresp -proto HTTP/1.2 -status 201 -msg Foo
+	txresp -proto HTTP/1.2 -status 201 -reason Foo
 }
 
 server s1 -start
diff --git a/bin/varnishtest/tests/a00005.vtc b/bin/varnishtest/tests/a00005.vtc
index 6c0d634..f8c27ae 100644
--- a/bin/varnishtest/tests/a00005.vtc
+++ b/bin/varnishtest/tests/a00005.vtc
@@ -5,7 +5,7 @@ server s1 {
 	expect req.method == PUT
 	expect req.proto == HTTP/1.0
 	expect req.url == "/foo"
-	txresp -proto HTTP/1.2 -status 201 -msg Foo
+	txresp -proto HTTP/1.2 -status 201 -reason Foo
 }
 
 server s2 {
diff --git a/bin/varnishtest/tests/a00006.vtc b/bin/varnishtest/tests/a00006.vtc
index f8a928e..81f7c6e 100644
--- a/bin/varnishtest/tests/a00006.vtc
+++ b/bin/varnishtest/tests/a00006.vtc
@@ -5,7 +5,7 @@ server s1 {
 	expect req.method == PUT
 	expect req.proto == HTTP/1.0
 	expect req.url == "/foo"
-	txresp -proto HTTP/1.2 -status 201 -msg Foo \
+	txresp -proto HTTP/1.2 -status 201 -reason Foo \
 		-body "987654321\n"
 }
 
diff --git a/bin/varnishtest/tests/r00962.vtc b/bin/varnishtest/tests/r00962.vtc
index cc5168c..dc79ae4 100644
--- a/bin/varnishtest/tests/r00962.vtc
+++ b/bin/varnishtest/tests/r00962.vtc
@@ -38,7 +38,7 @@ varnish v1 -stop
 
 server s1 {
 	rxreq
-	txresp -status 400 -msg "Persistent Object Not Found"
+	txresp -status 400 -reason "Persistent Object Not Found"
 } -start
 
 
diff --git a/bin/varnishtest/tests/r01485.vtc b/bin/varnishtest/tests/r01485.vtc
index abfe839..a6b8b60 100644
--- a/bin/varnishtest/tests/r01485.vtc
+++ b/bin/varnishtest/tests/r01485.vtc
@@ -6,7 +6,7 @@ server s1 {
 
 	rxreq
 	expect req.http.If-None-Match == {"foo"}
-	txresp -status 304 -msg "Not Modified"
+	txresp -status 304 -reason "Not Modified"
 } -start
 
 varnish v1 -vcl+backend {
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 48759de..1503b7e 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -823,7 +823,7 @@ cmd_http_txresp(CMD_ARGS)
 	struct http *hp;
 	const char *proto = "HTTP/1.1";
 	const char *status = "200";
-	const char *msg = "OK";
+	const char *reason = "OK";
 	char* body = NULL;
 
 	(void)cmd;
@@ -842,15 +842,15 @@ cmd_http_txresp(CMD_ARGS)
 		} else if (!strcmp(*av, "-status")) {
 			status = av[1];
 			av++;
-		} else if (!strcmp(*av, "-msg")) {
-			msg = av[1];
+		} else if (!strcmp(*av, "-reason") || !strcmp(*av, "-msg")) {
+			reason = av[1];
 			av++;
 			continue;
 		} else
 			break;
 	}
 
-	VSB_printf(hp->vsb, "%s %s %s%s", proto, status, msg, nl);
+	VSB_printf(hp->vsb, "%s %s %s%s", proto, status, reason, nl);
 
 	/* send a "Content-Length: 0" header unless something else happens */
 	REPLACE(body, "");



More information about the varnish-commit mailing list