[master] 4f66a21 rename "rxhdrs" to "rxreqhdrs" and add "rxresphdrs"
Poul-Henning Kamp
phk at FreeBSD.org
Thu Mar 13 15:46:32 CET 2014
commit 4f66a21d84a687eaf71a23f8e86a0c867a1a5aa5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Mar 13 14:46:06 2014 +0000
rename "rxhdrs" to "rxreqhdrs" and add "rxresphdrs"
diff --git a/bin/varnishtest/tests/r01356.vtc b/bin/varnishtest/tests/r01356.vtc
index 1aaa337..341f2c8 100644
--- a/bin/varnishtest/tests/r01356.vtc
+++ b/bin/varnishtest/tests/r01356.vtc
@@ -1,7 +1,7 @@
varnishtest "#1356, req.body failure"
server s1 {
- rxhdrs
+ rxreqhdrs
expect_close
} -start
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 271540b..4388f73 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -233,8 +233,12 @@ cmd_http_expect(CMD_ARGS)
AN(av[2]);
AZ(av[3]);
lhs = cmd_var_resolve(hp, av[0]);
+ if (lhs == NULL)
+ lhs = "<missing>";
cmp = av[1];
rhs = cmd_var_resolve(hp, av[2]);
+ if (rhs == NULL)
+ rhs = "<missing>";
if (!strcmp(cmp, "==")) {
retval = strcmp(lhs, rhs) == 0;
} else if (!strcmp(cmp, "<")) {
@@ -541,6 +545,25 @@ cmd_http_rxresp(CMD_ARGS)
vtc_log(hp->vl, 4, "bodylen = %s", hp->bodylen);
}
+static void
+cmd_http_rxresphdrs(CMD_ARGS)
+{
+ struct http *hp;
+
+ (void)cmd;
+ (void)vl;
+ CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
+ ONLY_CLIENT(hp, av);
+ assert(!strcmp(av[0], "rxresphdrs"));
+ av++;
+
+ for(; *av != NULL; av++)
+ vtc_log(hp->vl, 0, "Unknown http rxreq spec: %s\n", *av);
+ http_rxhdr(hp);
+ http_splitheader(hp, 0);
+}
+
+
/**********************************************************************
* Ungzip rx'ed body
*/
@@ -802,14 +825,14 @@ cmd_http_rxreq(CMD_ARGS)
}
static void
-cmd_http_rxhdrs(CMD_ARGS)
+cmd_http_rxreqhdrs(CMD_ARGS)
{
struct http *hp;
(void)cmd;
(void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
- assert(!strcmp(av[0], "rxhdrs"));
+ assert(!strcmp(av[0], "rxreqhdrs"));
av++;
for(; *av != NULL; av++)
@@ -1169,12 +1192,13 @@ static const struct cmds http_cmds[] = {
{ "txreq", cmd_http_txreq },
{ "rxreq", cmd_http_rxreq },
- { "rxhdrs", cmd_http_rxhdrs },
+ { "rxreqhdrs", cmd_http_rxreqhdrs },
{ "rxchunk", cmd_http_rxchunk },
{ "rxbody", cmd_http_rxbody },
{ "txresp", cmd_http_txresp },
{ "rxresp", cmd_http_rxresp },
+ { "rxresphdrs", cmd_http_rxresphdrs },
{ "gunzip", cmd_http_gunzip_body },
{ "expect", cmd_http_expect },
{ "send", cmd_http_send },
More information about the varnish-commit
mailing list