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

Add "-x dumpbuiltin" to varnishd

parent 26c3d5bd
......@@ -26,17 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
* The built-in (previously called default) VCL code.
*
* NB! You do NOT need to copy & paste all of these functions into your
* own vcl code, if you do not provide a definition of one of these
* functions, the compiler will automatically fall back to the default
* code from this file.
*
* This code will be prefixed with a backend declaration built from the
* -b argument.
* This is the builtin VCL code
*/
vcl 4.0;
......
......@@ -178,6 +178,7 @@ void STV_Config(const char *spec);
void STV_Config_Transient(void);
/* mgt_vcc.c */
void mgt_DumpBuiltin(void);
char *mgt_VccCompile(struct cli *, struct vclprog *, const char *vclname,
const char *vclsrc, const char *vclsrcfile, int C_flag);
......
......@@ -340,6 +340,8 @@ mgt_x_arg(const char *x_arg)
mgt_DumpRstVsl();
else if (!strcmp(x_arg, "dumprstcli"))
mgt_DumpRstCli();
else if (!strcmp(x_arg, "dumpbuiltin"))
mgt_DumpBuiltin();
else
ARGV_ERR("Invalid -x argument\n");
}
......
......@@ -76,6 +76,12 @@ static const char * const builtin_vcl =
#include "builtin_vcl.h"
"" ;
void
mgt_DumpBuiltin(void)
{
puts(builtin_vcl);
}
/*--------------------------------------------------------------------
* Invoke system VCC compiler in a sub-process
*/
......
......@@ -4,6 +4,7 @@ shell "varnishd -b 127.0.0.1:80 -C 2> ${tmpdir}/_.c"
shell "varnishd -x dumprstparam > ${tmpdir}/_.param"
shell "varnishd -x dumprstvsl > ${tmpdir}/_.vsl"
shell "varnishd -x dumprstcli > ${tmpdir}/_.cli"
shell "varnishd -x dumpbuiltin > ${tmpdir}/_.builtin"
shell -err -expect {VCL version declaration missing} {
echo 'bad vcl' > ${tmpdir}/t.vcl
varnishd -f ${tmpdir}/t.vcl -n ${tmpdir}
......
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