[6.0] 4d16ee921 Allow now to be used in vcl_init

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jun 27 17:05:09 UTC 2019


commit 4d16ee921440f002e6d2b8b13ac8c7e00605227b
Author: Reza Naghibi <reza at naghibi.com>
Date:   Thu Dec 6 20:58:38 2018 -0500

    Allow now to be used in vcl_init

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 4cf196ea0..f267fd01a 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -44,6 +44,7 @@
 #include "cache_director.h"
 #include "cache_vcl.h"
 #include "vcli_serve.h"
+#include "vtim.h"
 
 const char * const VCL_TEMP_INIT = "init";
 const char * const VCL_TEMP_COLD = "cold";
@@ -115,6 +116,7 @@ vcl_get_ctx(unsigned method, int msg)
 	handling_cli = 0;
 	ctx_cli.handling = &handling_cli;
 	ctx_cli.method = method;
+	ctx_cli.now = VTIM_real();
 	if (msg) {
 		ctx_cli.msg = VSB_new_auto();
 		AN(ctx_cli.msg);


More information about the varnish-commit mailing list