Commit 05b93afe authored by Geoff Simmons's avatar Geoff Simmons

varnishevent only uses the real clock; and a bugfix for format %t

parent 73909737
......@@ -65,9 +65,6 @@ typedef struct compiled_fmt_t {
static compiled_fmt_t cformat, bformat, zformat;
/* Difference between the real and monotonic clocks */
static double TIM_real_mono_diff;
static char i_arg[BUFSIZ] = "";
static int read_rx_hdr = 0, read_tx_hdr = 0, read_vcl_log = 0,
......@@ -126,14 +123,11 @@ get_tm(logline_t *ll, struct tm * t) {
date_rec = GET_HDR(ll, rx, "Date");
}
else if (B(ll->spec)) {
if (TAG(ll,SLT_BackendReq).len
&& (ts = get_fld(&TAG(ll,SLT_BackendReq), 2)) != NULL)
tt = (time_t) (atol(ts) + TIM_real_mono_diff);
else
date_rec = GET_HDR(ll, tx, "Date");
if ((date_rec = GET_HDR(ll, tx, "Date")) == NULL)
tt = (time_t) ll->t;
}
else
tt = (time_t) (ll->t + TIM_real_mono_diff);
tt = (time_t) ll->t;
if (date_rec)
tt = TIM_parse(&date_rec->data[strlen("Date: ")]);
......@@ -654,12 +648,10 @@ compile_fmt(char *format, compiled_fmt_t *fmt, unsigned spec, char *err)
add_fmt(fmt, os, n, format_t, NULL, 0);
if (C(spec)) {
ADD_TAG(fmt->tags, ReqEnd);
ADD_TAG(fmt->tags, RxHeader);
}
else if (B(spec)) {
ADD_TAG(fmt->tags, BackendReq);
ADD_TAG(fmt->tags, TxHeader);
}
else if (B(spec))
ADD_TAG(fmt->tags, RxHeader);
n++;
break;
......@@ -821,8 +813,6 @@ FMT_Init(char *err)
if (compile_fmt(config.zformat, &zformat, 0, err) != 0)
return EINVAL;
TIM_real_mono_diff = TIM_real() - TIM_mono();
strcpy(hit, "hit");
strcpy(miss, "miss");
strcpy(pass, "pass");
......
......@@ -445,7 +445,7 @@ event(void *priv, enum VSL_tag_e tag, unsigned fd,
assert(lp->vcl_log == NULL || lp->vcl_log->nrec == 0);
/* XXX: assert that all lp->tag[i].len == 0 ? */
t = TIM_mono();
t = TIM_real();
fd_tbl[fd].ll = lp;
lp->state = DATA_OPEN;
lp->t = t;
......
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