Commit 33666d69 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

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).
parent e77e315c
...@@ -5,7 +5,7 @@ server s1 { ...@@ -5,7 +5,7 @@ server s1 {
expect req.method == PUT expect req.method == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
expect req.url == "/foo" 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 server s1 -start
......
...@@ -5,7 +5,7 @@ server s1 { ...@@ -5,7 +5,7 @@ server s1 {
expect req.method == PUT expect req.method == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
expect req.url == "/foo" expect req.url == "/foo"
txresp -proto HTTP/1.2 -status 201 -msg Foo txresp -proto HTTP/1.2 -status 201 -reason Foo
} }
server s2 { server s2 {
......
...@@ -5,7 +5,7 @@ server s1 -repeat 2 { ...@@ -5,7 +5,7 @@ server s1 -repeat 2 {
expect req.method == PUT expect req.method == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
expect req.url == "/foo" 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 server s1 -start
......
...@@ -5,7 +5,7 @@ server s1 { ...@@ -5,7 +5,7 @@ server s1 {
expect req.method == PUT expect req.method == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
expect req.url == "/foo" expect req.url == "/foo"
txresp -proto HTTP/1.2 -status 201 -msg Foo txresp -proto HTTP/1.2 -status 201 -reason Foo
} }
server s2 { server s2 {
......
...@@ -5,7 +5,7 @@ server s1 { ...@@ -5,7 +5,7 @@ server s1 {
expect req.method == PUT expect req.method == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
expect req.url == "/foo" 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" -body "987654321\n"
} }
......
...@@ -38,7 +38,7 @@ varnish v1 -stop ...@@ -38,7 +38,7 @@ varnish v1 -stop
server s1 { server s1 {
rxreq rxreq
txresp -status 400 -msg "Persistent Object Not Found" txresp -status 400 -reason "Persistent Object Not Found"
} -start } -start
......
...@@ -6,7 +6,7 @@ server s1 { ...@@ -6,7 +6,7 @@ server s1 {
rxreq rxreq
expect req.http.If-None-Match == {"foo"} expect req.http.If-None-Match == {"foo"}
txresp -status 304 -msg "Not Modified" txresp -status 304 -reason "Not Modified"
} -start } -start
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
......
...@@ -823,7 +823,7 @@ cmd_http_txresp(CMD_ARGS) ...@@ -823,7 +823,7 @@ cmd_http_txresp(CMD_ARGS)
struct http *hp; struct http *hp;
const char *proto = "HTTP/1.1"; const char *proto = "HTTP/1.1";
const char *status = "200"; const char *status = "200";
const char *msg = "OK"; const char *reason = "OK";
char* body = NULL; char* body = NULL;
(void)cmd; (void)cmd;
...@@ -842,15 +842,15 @@ cmd_http_txresp(CMD_ARGS) ...@@ -842,15 +842,15 @@ cmd_http_txresp(CMD_ARGS)
} else if (!strcmp(*av, "-status")) { } else if (!strcmp(*av, "-status")) {
status = av[1]; status = av[1];
av++; av++;
} else if (!strcmp(*av, "-msg")) { } else if (!strcmp(*av, "-reason") || !strcmp(*av, "-msg")) {
msg = av[1]; reason = av[1];
av++; av++;
continue; continue;
} else } else
break; 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 */ /* send a "Content-Length: 0" header unless something else happens */
REPLACE(body, ""); REPLACE(body, "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment