summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39a1828)
raw | patch | inline | side by side (parent: 39a1828)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Thu, 2 Apr 2015 16:21:52 +0000 (18:21 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Thu, 2 Apr 2015 16:21:52 +0000 (18:21 +0200) |
also use plugin_get_interval() rather than cf_get_default_interval() to
take per-plugin interval in account.
take per-plugin interval in account.
src/curl.c | patch | blob | history |
diff --git a/src/curl.c b/src/curl.c
index 503153913052b2943ad1451d2d95439be1f48160..893cc54ca628cd8046af5a419752dd8e36e6fa1c 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
curl_easy_setopt (wp->curl, CURLOPT_HTTPHEADER, wp->headers);
if (wp->post_body != NULL)
curl_easy_setopt (wp->curl, CURLOPT_POSTFIELDS, wp->post_body);
- curl_easy_setopt (wp->curl, CURLOPT_TIMEOUT_MS, wp->timeout > 0 ? wp->timeout : cf_get_default_interval ());
+
+ if (wp->timeout >= 0)
+ curl_easy_setopt (wp->curl, CURLOPT_TIMEOUT_MS, wp->timeout);
+ else
+ curl_easy_setopt (wp->curl, CURLOPT_TIMEOUT_MS,
+ CDTIME_T_TO_MS(plugin_get_interval()));
return (0);
} /* }}} int cc_page_init_curl */
page->verify_host = 1;
page->response_time = 0;
page->response_code = 0;
- page->timeout = 0;
+ page->timeout = -1;
page->instance = strdup (ci->values[0].value.string);
if (page->instance == NULL)