Commit c654ff91 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Complain if there are sub-arguments to the -a protocol specs which don't

understand them.

Fixes: #1770
parent 561b56ce
......@@ -192,9 +192,13 @@ MAC_Arg(const char *arg)
if (av[2] == NULL || !strcmp(av[2], "HTTP/1")) {
mh->first_step = S_STP_H1NEWSESS;
mh->proto_name = "HTTP/1";
if (av[2] != NULL && av[3] != NULL)
ARGV_ERR("Too many sub-arguments to -a(HTTP/1))\n");
} else if (!strcmp(av[2], "PROXY")) {
mh->first_step = S_STP_PROXYNEWSESS;
mh->proto_name = "PROXY";
if (av[3] != NULL)
ARGV_ERR("Too many sub-arguments to -a(PROXY))\n");
} else {
ARGV_ERR("Unknown protocol '%s'\n", av[2]);
}
......
varnishtest "bad protocol specs for -a"
err_shell "Too many sub-arguments" "${varnishd} -a 127.0.0.1:80000,PROXY,FOO -d 2>&1"
err_shell "Too many sub-arguments" "${varnishd} -a 127.0.0.1:80000,HTTP/1,FOO -d 2>&1"
err_shell "Too many sub-arguments" "${varnishd} -a 127.0.0.1:80000,HTTP/1 -d 2>&1"
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