Commit 955519b7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a magic ${date} macro, which inserts a RFC2616 format timestamp

of the present time.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5504 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 97d18936
......@@ -134,10 +134,19 @@ macro_get(const char *b, const char *e)
{
struct macro *m;
int l;
char *retval = NULL;
AZ(pthread_mutex_lock(&macro_mtx));
l = e - b;
if (l == 4 && !memcmp(b, "date", l)) {
double t = TIM_real();
retval = malloc(64);
AN(retval);
TIM_format(t, retval);
return (retval);
}
AZ(pthread_mutex_lock(&macro_mtx));
VTAILQ_FOREACH(m, &macro_list, list)
if (!memcmp(b, m->name, l) && m->name[l] == '\0')
break;
......
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