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

Add -proto argument to specify listen protocols

parent 1dbd3c74
...@@ -69,6 +69,7 @@ struct varnish { ...@@ -69,6 +69,7 @@ struct varnish {
int vcl_nbr; int vcl_nbr;
char *workdir; char *workdir;
char *jail; char *jail;
char *proto;
struct VSM_data *vd; /* vsc use */ struct VSM_data *vd; /* vsc use */
...@@ -396,6 +397,8 @@ varnish_launch(struct varnish *v) ...@@ -396,6 +397,8 @@ varnish_launch(struct varnish *v)
VSB_printf(vsb, " -p thread_pool_min=10"); VSB_printf(vsb, " -p thread_pool_min=10");
VSB_printf(vsb, " -p debug=+vtc_mode"); VSB_printf(vsb, " -p debug=+vtc_mode");
VSB_printf(vsb, " -a '%s'", "127.0.0.1:0"); VSB_printf(vsb, " -a '%s'", "127.0.0.1:0");
if (v->proto != NULL)
VSB_printf(vsb, ",%s", v->proto);
VSB_printf(vsb, " -M '%s %s'", abuf, pbuf); VSB_printf(vsb, " -M '%s %s'", abuf, pbuf);
VSB_printf(vsb, " -P %s/varnishd.pid", v->workdir); VSB_printf(vsb, " -P %s/varnishd.pid", v->workdir);
VSB_printf(vsb, " %s", VSB_data(v->args)); VSB_printf(vsb, " %s", VSB_data(v->args));
...@@ -887,13 +890,6 @@ cmd_varnish(CMD_ARGS) ...@@ -887,13 +890,6 @@ cmd_varnish(CMD_ARGS)
for (; *av != NULL; av++) { for (; *av != NULL; av++) {
if (vtc_error) if (vtc_error)
break; break;
if (!strcmp(*av, "-jail")) {
AN(av[1]);
AZ(v->pid);
REPLACE(v->jail, av[1]);
av++;
continue;
}
if (!strcmp(*av, "-arg")) { if (!strcmp(*av, "-arg")) {
AN(av[1]); AN(av[1]);
AZ(v->pid); AZ(v->pid);
...@@ -908,12 +904,6 @@ cmd_varnish(CMD_ARGS) ...@@ -908,12 +904,6 @@ cmd_varnish(CMD_ARGS)
av++; av++;
continue; continue;
} }
if (!strcmp(*av, "-cliok")) {
AN(av[1]);
varnish_cli(v, av[1], (unsigned)CLIS_OK);
av++;
continue;
}
if (!strcmp(*av, "-clierr")) { if (!strcmp(*av, "-clierr")) {
AN(av[1]); AN(av[1]);
AN(av[2]); AN(av[2]);
...@@ -921,13 +911,9 @@ cmd_varnish(CMD_ARGS) ...@@ -921,13 +911,9 @@ cmd_varnish(CMD_ARGS)
av += 2; av += 2;
continue; continue;
} }
if (!strcmp(*av, "-start")) { if (!strcmp(*av, "-cliok")) {
varnish_start(v);
continue;
}
if (!strcmp(*av, "-vcl+backend")) {
AN(av[1]); AN(av[1]);
varnish_vclbackend(v, av[1]); varnish_cli(v, av[1], (unsigned)CLIS_OK);
av++; av++;
continue; continue;
} }
...@@ -948,16 +934,46 @@ cmd_varnish(CMD_ARGS) ...@@ -948,16 +934,46 @@ cmd_varnish(CMD_ARGS)
av += 2; av += 2;
continue; continue;
} }
if (!strcmp(*av, "-vcl")) { if (!strcmp(*av, "-expect")) {
av++;
varnish_expect(v, av);
av += 2;
continue;
}
if (!strcmp(*av, "-jail")) {
AN(av[1]); AN(av[1]);
varnish_vcl(v, av[1], CLIS_OK, NULL); AZ(v->pid);
REPLACE(v->jail, av[1]);
av++;
continue;
}
if (!strcmp(*av, "-proto")) {
AN(av[1]);
AZ(v->pid);
REPLACE(v->proto, av[1]);
av++; av++;
continue; continue;
} }
if (!strcmp(*av, "-start")) {
varnish_start(v);
continue;
}
if (!strcmp(*av, "-stop")) { if (!strcmp(*av, "-stop")) {
varnish_stop(v); varnish_stop(v);
continue; continue;
} }
if (!strcmp(*av, "-vcl")) {
AN(av[1]);
varnish_vcl(v, av[1], CLIS_OK, NULL);
av++;
continue;
}
if (!strcmp(*av, "-vcl+backend")) {
AN(av[1]);
varnish_vclbackend(v, av[1]);
av++;
continue;
}
if (!strcmp(*av, "-wait-stopped")) { if (!strcmp(*av, "-wait-stopped")) {
wait_stopped(v); wait_stopped(v);
continue; continue;
...@@ -970,12 +986,6 @@ cmd_varnish(CMD_ARGS) ...@@ -970,12 +986,6 @@ cmd_varnish(CMD_ARGS)
varnish_wait(v); varnish_wait(v);
continue; continue;
} }
if (!strcmp(*av, "-expect")) {
av++;
varnish_expect(v, av);
av += 2;
continue;
}
vtc_log(v->vl, 0, "Unknown varnish argument: %s", *av); vtc_log(v->vl, 0, "Unknown varnish argument: %s", *av);
} }
} }
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