summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bca0f0a)
raw | patch | inline | side by side (parent: bca0f0a)
author | Alexey Remizov <rem@onsec.ru> | |
Fri, 22 Aug 2014 07:02:47 +0000 (11:02 +0400) | ||
committer | Alexey Remizov <rem@onsec.ru> | |
Fri, 22 Aug 2014 07:02:47 +0000 (11:02 +0400) |
src/configfile.c | patch | blob | history | |
src/plugin.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index d2a307d9451d97babd69c1a14e4fd0548dc9c4ae..8c5ecdfc9b849c4b9dcb323200b584fd1824de4d 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
{"Timeout", NULL, "2"},
{"AutoLoadPlugin", NULL, "false"},
{"PreCacheChain", NULL, "PreCache"},
- {"PostCacheChain", NULL, "PostCache"}
+ {"PostCacheChain", NULL, "PostCache"},
+ {"MaxEffectiveInterval", NULL, "86400"}
};
static int cf_global_options_num = STATIC_ARRAY_SIZE (cf_global_options);
diff --git a/src/plugin.c b/src/plugin.c
index 30a1ff1a304911f91e571fe56cd22c4d15535078..8407318973e49bc11880a7e6103d5cfa5e1a4559 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
* intervals in which it will be called. */
if (status != 0)
{
+ const char *mei = global_option_get ("MaxEffectiveInterval");
+ int max_effective_interval = atoi (mei);
+ if (max_effective_interval <= 0) {
+ max_effective_interval = 86400;
+ }
rf->rf_effective_interval *= 2;
- if (rf->rf_effective_interval > TIME_T_TO_CDTIME_T (86400))
- rf->rf_effective_interval = TIME_T_TO_CDTIME_T (86400);
+ if (rf->rf_effective_interval > TIME_T_TO_CDTIME_T (max_effective_interval))
+ rf->rf_effective_interval = TIME_T_TO_CDTIME_T (max_effective_interval);
NOTICE ("read-function of plugin `%s' failed. "
"Will suspend it for %.3f seconds.",