Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # To allow inline-C in VCL start varnishd with -p vcc_allow_inline_c=on
- C{
- #include <sys/time.h>
- #include <stdio.h>
- static const struct gethdr_s VGC_HDR_REQ_reqstart = { HDR_REQ, "\020X-Request-Start:" };
- }C
- sub vcl_recv {
- # Add X-Request-Start header for New Relic queue time analytics
- C{
- struct timeval detail_time;
- gettimeofday(&detail_time, NULL);
- char start[20];
- sprintf(start, "t=%lu%06lu", detail_time.tv_sec, detail_time.tv_usec);
- VRT_SetHdr(ctx, &VGC_HDR_REQ_reqstart, start, vrt_magic_string_end);
- }C
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement