From b2190647940f4ffaa8cbc51ff0ecaf03e8fde17a Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Dec 31 2016 13:09:00 +0000 Subject: Fix delay handling --- diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index 6ef1c25..a56b01a 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -96,7 +96,7 @@ sub upload { } # If the file size is lower than the lowest configured size or if there is no delay_for_size setting, we choose the configured max delay unless (defined $delay) { - $delay = ($json->{delay} <= $c->max_delay || $c->max_delay == 0) ? $json->{delay} : $c->max_delay; + $delay = (($json->{delay} > 0 && $json->{delay} <= $c->max_delay) || $c->max_delay == 0) ? $json->{delay} : $c->max_delay; } my $creator = $c->ip;