Commit 192637a3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make add info to the boot VCL about where it came from, -b or -f argument.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4462 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 22c54a22
......@@ -66,7 +66,7 @@ void MCF_ParamSet(struct cli *, const char *param, const char *val);
/* mgt_vcc.c */
void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, char *vcl, int Cflag);
int mgt_vcc_default(const char *bflag, const char *f_arg, char *vcl, int Cflag);
int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void);
extern char *mgt_cc_cmd;
......
......@@ -325,12 +325,13 @@ mgt_vcc_delbyname(const char *name)
/*--------------------------------------------------------------------*/
int
mgt_vcc_default(const char *b_arg, char *vcl, int C_flag)
mgt_vcc_default(const char *b_arg, const char *f_arg, char *vcl, int C_flag)
{
char *addr, *port;
char *vf;
struct vsb *sb;
struct vclprog *vp;
char buf[BUFSIZ];
if (b_arg != NULL) {
AZ(vcl);
......@@ -363,6 +364,9 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag)
free(addr);
free(port);
AN(vcl);
bprintf(buf, "boot (-b %s)", b_arg);
} else {
brintf(buf, "boot (-f %s)", f_arg);
}
vf = mgt_VccCompile(&sb, vcl, C_flag);
......@@ -379,7 +383,7 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag)
fprintf(stderr, "\nVCL compilation failed\n");
return (1);
}
vp = mgt_vcc_add("boot", vf);
vp = mgt_vcc_add(buf, vf);
vp->active = 1;
return (0);
}
......
......@@ -727,7 +727,7 @@ main(int argc, char * const *argv)
}
if (b_arg != NULL || f_arg != NULL)
if (mgt_vcc_default(b_arg, vcl, C_flag))
if (mgt_vcc_default(b_arg, f_arg, vcl, C_flag))
exit (2);
if (C_flag)
......
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