[5.2] 38ef9b5 Accept a negative TTL with purge.soft
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Thu Sep 7 06:59:07 UTC 2017
commit 38ef9b56ca4f0c6841ac631a430eed7dab4984d6
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Sep 5 09:57:32 2017 +0200
Accept a negative TTL with purge.soft
diff --git a/lib/libvmod_purge/vmod.vcc b/lib/libvmod_purge/vmod.vcc
index a935732..1e9259e 100644
--- a/lib/libvmod_purge/vmod.vcc
+++ b/lib/libvmod_purge/vmod.vcc
@@ -93,8 +93,8 @@ $Function INT soft(DURATION ttl = 0, DURATION grace = -1, DURATION keep = -1)
Description
Sets the TTL, grace and keep. By default, TTL is set to 0 with grace
- and keep periods left untouched. Setting a negative value for any of
- the parameters leaves them untouched. Setting all three parameters to
+ and keep periods left untouched. Setting a negative value for grace or
+ keep periods leaves them untouched. Setting all three parameters to
0 is equivalent to a hard purge. It can only be called from ``vcl_hit``
or ``vcl_miss``. It returns the number of soft-purged objects.
diff --git a/lib/libvmod_purge/vmod_purge.c b/lib/libvmod_purge/vmod_purge.c
index 7fba6b2..4ba039b 100644
--- a/lib/libvmod_purge/vmod_purge.c
+++ b/lib/libvmod_purge/vmod_purge.c
@@ -49,8 +49,6 @@ vmod_soft(VRT_CTX, VCL_DURATION ttl, VCL_DURATION grace, VCL_DURATION keep)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
- if (ttl < 0)
- ttl = NAN;
if (grace < 0)
grace = NAN;
if (keep < 0)
More information about the varnish-commit
mailing list