Skip to content

Instantly share code, notes, and snippets.

@timglabisch
Created March 27, 2013 16:52
Show Gist options
  • Save timglabisch/5255954 to your computer and use it in GitHub Desktop.
Save timglabisch/5255954 to your computer and use it in GitHub Desktop.
Varnish Inline C Random + Timestamp
C{
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
}C
C{
struct timeval tv;
char txt[200];
gettimeofday(&tv, NULL);
sprintf(txt, "%d and time %d", rand()%4, (int)tv.tv_sec);
VRT_synth_page(sp, 0, txt, vrt_magic_string_end);
}C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment