<div dir="ltr"><div>The doc bit is missing and vcc_TimeUnit() should be updated as well.<br><br></div>f.-<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 12:51 PM, Poul-Henning Kamp <span dir="ltr"><<a href="mailto:phk@freebsd.org" target="_blank">phk@freebsd.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
commit f6ef923b2155b323f5182eeae2d4423796cd35b9<br>
Author: Poul-Henning Kamp <phk@FreeBSD.org><br>
Date: Mon May 5 11:50:39 2014 +0000<br>
<br>
Add a 'y'ear conversion factor to std.duration().<br>
<br>
Submitted by: github::brianjarita<br>
<br>
diff --git a/bin/varnishtest/tests/m00005.vtc b/bin/varnishtest/tests/m00005.vtc<br>
index 53f5ae3..5ef9dde 100644<br>
--- a/bin/varnishtest/tests/m00005.vtc<br>
+++ b/bin/varnishtest/tests/m00005.vtc<br>
@@ -97,4 +97,10 @@ client c1 {<br>
expect resp.http.ttl == 1000002.000<br>
expect resp.bodylen == 1<br>
<br>
+ txreq -url "/1" -hdr "ttl: 1y"<br>
+ rxresp<br>
+ expect resp.status == 200<br>
+ expect resp.http.ttl == 32536001.000<br>
+ expect resp.bodylen == 1<br>
+<br>
} -run<br>
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c<br>
index b9020d1..f98b5fb 100644<br>
--- a/lib/libvmod_std/vmod_std_conversions.c<br>
+++ b/lib/libvmod_std/vmod_std_conversions.c<br>
@@ -86,6 +86,7 @@ vmod_duration(const struct vrt_ctx *ctx, const char *p, VCL_DURATION d)<br>
case 'h': r *= 60.*60.; break;<br>
case 'd': r *= 60.*60.*24.; break;<br>
case 'w': r *= 60.*60.*24.*7.; break;<br>
+ case 'y': r *= 60.*60.*24.*365.; break;<br>
default:<br>
return (d);<br>
}<br>
<br>
_______________________________________________<br>
varnish-commit mailing list<br>
<a href="mailto:varnish-commit@varnish-cache.org">varnish-commit@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit</a><br>
</blockquote></div><br></div>