[master] f6ef923 Add a 'y'ear conversion factor to std.duration().

Federico Schwindt fgsch at lodoss.net
Mon May 5 17:27:58 CEST 2014


The doc bit is missing and vcc_TimeUnit() should be updated as well.

f.-


On Mon, May 5, 2014 at 12:51 PM, Poul-Henning Kamp <phk at freebsd.org> wrote:

>
> commit f6ef923b2155b323f5182eeae2d4423796cd35b9
> Author: Poul-Henning Kamp <phk at FreeBSD.org>
> Date:   Mon May 5 11:50:39 2014 +0000
>
>     Add a 'y'ear conversion factor to std.duration().
>
>     Submitted by:       github::brianjarita
>
> diff --git a/bin/varnishtest/tests/m00005.vtc
> b/bin/varnishtest/tests/m00005.vtc
> index 53f5ae3..5ef9dde 100644
> --- a/bin/varnishtest/tests/m00005.vtc
> +++ b/bin/varnishtest/tests/m00005.vtc
> @@ -97,4 +97,10 @@ client c1 {
>         expect resp.http.ttl == 1000002.000
>         expect resp.bodylen == 1
>
> +       txreq -url "/1"  -hdr "ttl: 1y"
> +       rxresp
> +       expect resp.status == 200
> +       expect resp.http.ttl == 32536001.000
> +       expect resp.bodylen == 1
> +
>  } -run
> diff --git a/lib/libvmod_std/vmod_std_conversions.c
> b/lib/libvmod_std/vmod_std_conversions.c
> index b9020d1..f98b5fb 100644
> --- a/lib/libvmod_std/vmod_std_conversions.c
> +++ b/lib/libvmod_std/vmod_std_conversions.c
> @@ -86,6 +86,7 @@ vmod_duration(const struct vrt_ctx *ctx, const char *p,
> VCL_DURATION d)
>         case 'h': r *= 60.*60.; break;
>         case 'd': r *= 60.*60.*24.; break;
>         case 'w': r *= 60.*60.*24.*7.; break;
> +       case 'y': r *= 60.*60.*24.*365.; break;
>         default:
>                 return (d);
>         }
>
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-commit/attachments/20140505/e1bfb462/attachment.html>


More information about the varnish-commit mailing list