[master] 83a93b0 Accept a negative TTL with purge.soft
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Sep 5 12:00:11 CEST 2017
commit 83a93b0bd12cabed7cf3b1c0aaba71ff701b6800
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