possibly need this option. What CA certificates come bundled with C<libcurl>
and are checked by default depends on the distribution you use.
+=item B<Timeout> I<Milliseconds>
+
+The B<Timeout> option sets the overall timeout for HTTP requests, in
+milliseconds. By default, the configured B<Interval> is used to set the
+timeout.
+
=back
=head2 Plugin C<notify_desktop>
static char *verify_peer = NULL;
static char *verify_host = NULL;
static char *cacert = NULL;
+static char *timeout = NULL;
static CURL *curl = NULL;
"Password",
"VerifyPeer",
"VerifyHost",
- "CACert"
+ "CACert",
+ "Timeout"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
return (config_set (&verify_host, value));
else if (strcasecmp (key, "cacert") == 0)
return (config_set (&cacert, value));
+ else if (strcasecmp (key, "timeout") == 0)
+ return (config_set (&timeout, value));
else
return (-1);
} /* int config */
curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
}
+ if (timeout != NULL)
+ {
+ curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atoi(timeout));
+ }
+ else
+ {
+ curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,
+ CDTIME_T_TO_MS(plugin_get_interval()));
+ }
+
return (0);
} /* void init */