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 {
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
......
......@@ -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 {
......
......@@ -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
......
......@@ -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 {
......
......@@ -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"
}
......
......@@ -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
......
......@@ -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 {
......
......@@ -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, "");
......
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