From bc5a414594716310d5d814c7d08d347fff45b7f2 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Mon, 19 Apr 2010 17:19:56 +0200 Subject: [PATCH] $curl can now use 0 (immediately) as interval --- doc/variables.xml | 4 ++-- src/ccurl_thread.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/variables.xml b/doc/variables.xml index c7ac6ffe..96b8b4e6 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -675,8 +675,8 @@ Download data from URI using Curl at the - specified interval. The interval may be a floating - point value greater than 0, otherwise defaults to 15 + specified interval. The interval may be a positive floating + point value (0 is allowed), otherwise defaults to 15 minutes. Most useful when used in conjunction with Lua and the Lua API. This object is threaded, and once a thread is created it can't be explicitly destroyed. diff --git a/src/ccurl_thread.cc b/src/ccurl_thread.cc index 82401dde..fdd0f14b 100644 --- a/src/ccurl_thread.cc +++ b/src/ccurl_thread.cc @@ -222,7 +222,7 @@ void curl_parse_arg(struct text_object *obj, const char *arg) NORM_ERR("wrong number of arguments for $curl"); return; } - cd->interval = interval > 0 ? interval * 60 : 15*60; + cd->interval = (argc == 2 && interval >= 0) ? interval * 60 : 15*60; obj->data.opaque = cd; }