Commit 33cd802c authored by Geoff Simmons's avatar Geoff Simmons

varnishevent: bestats-specific code depends on -DBESTATS

parent 6e39d606
......@@ -191,8 +191,6 @@ DATA_Take_Freelist(struct freehead_s *dst)
/*
* return to global freelist
* returned must be locked by caller, if required
* Space is returned to the front of the free list, so that it is likely
* to be re-used
*/
void
DATA_Return_Freelist(struct freehead_s *returned, unsigned nreturned)
......
......@@ -374,6 +374,7 @@ format_Xttfb_client(logline_t *ll, char *name, enum VSL_tag_e tag,
RETURN_FLD(TAG(ll,SLT_ReqEnd), 5, s, len);
}
#ifdef BESTATS
static void
format_Xttfb_backend(logline_t *ll, char *name, enum VSL_tag_e tag,
char **s, size_t *len)
......@@ -394,6 +395,7 @@ format_Xttfb_backend(logline_t *ll, char *name, enum VSL_tag_e tag,
*len = strlen(scratch);
}
}
#endif
static void
format_VCL_disp(logline_t *ll, char *name, enum VSL_tag_e tag,
......@@ -698,7 +700,6 @@ compile_fmt(char *format, compiled_fmt_t *fmt, unsigned spec, char *err)
ADD_TAG(fmt->tags, RxHeader);
}
else if (B(spec)) {
ADD_TAG(fmt->tags, BackendReq);
ADD_TAG(fmt->tags, TxHeader);
}
n++;
......@@ -706,13 +707,23 @@ compile_fmt(char *format, compiled_fmt_t *fmt, unsigned spec, char *err)
break;
case 'x':
if (strcmp(fname, "Varnish:time_firstbyte") == 0) {
ADD_FMT(spec, fmt, os, n, format_Xttfb, NULL, 0);
if (C(spec))
ADD_TAG(fmt->tags, ReqEnd);
#ifdef BESTATS
else {
ADD_TAG(fmt->tags, BackendReq);
ADD_TAG(fmt->tags, Fetch_Hdr);
}
ADD_FMT(spec, fmt, os, n, format_Xttfb, NULL, 0);
#else
else {
sprintf(err,
"Varnish:time_firstbyte only permitted "
"for client formats");
return 1;
}
add_fmt(fmt, os, n, format_Xttfb_client, NULL, 0);
#endif
}
else if (strcmp(fname, "Varnish:hitmiss") == 0) {
if (C(spec)) {
......
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