Commit 43cc2827 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Give vrt_ctx a "double now" timestamp for use in VCL/VRT/VMODs

Conflicts:
	bin/varnishd/cache/cache_vcl.c
	include/vrt.h
parent 746e41c3
......@@ -42,6 +42,7 @@
#include "vrt.h"
#include "vcli.h"
#include "vcli_priv.h"
#include "vtim.h"
struct vcls {
unsigned magic;
......@@ -436,6 +437,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
ctx.req = req;
if (req->obj)
ctx.http_obj = req->obj->http;
ctx.now = req->t_prev;
}
if (bo != NULL) {
// AZ(req);
......@@ -446,7 +448,10 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
ctx.http_bereq = bo->bereq;
ctx.http_beresp = bo->beresp;
ctx.bo = bo;
ctx.now = bo->t_prev;
}
if (ctx.now == 0)
ctx.now = VTIM_real();
ctx.ws = ws;
ctx.method = method;
ctx.handling = &wrk->handling;
......
......@@ -102,6 +102,7 @@ struct vrt_ctx {
struct http *http_bereq;
struct http *http_beresp;
double now;
};
/***********************************************************************/
......
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