[have_curlopt_username="yes"],
[have_curlopt_username="no"],
[[#include <curl/curl.h>]])
+ AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
+ [have_curlopt_timeout="yes"],
+ [have_curlopt_timeout="no"],
+ [[#include <curl/curl.h>]])
fi
fi
if test "x$with_libcurl" = "xyes"
then
AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
fi
+
+ if test "x$have_curlopt_timeout" = "xyes"
+ then
+ AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
+ fi
fi
AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
# }}}
if (st->cacert != NULL)
curl_easy_setopt (st->curl, CURLOPT_CAINFO, st->cacert);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (st->timeout >= 0)
curl_easy_setopt (st->curl, CURLOPT_TIMEOUT_MS, (long) st->timeout);
else
curl_easy_setopt (st->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int init_host */
if (cacert != NULL)
curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (timeout != NULL)
curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atol(timeout));
else
curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int ascent_init */
curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL);
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt (curl, CURLOPT_MAXREDIRS, 50L);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, (timeout >= 0) ?
(long) timeout : CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
if (wp->post_body != NULL)
curl_easy_setopt (wp->curl, CURLOPT_POSTFIELDS, wp->post_body);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (wp->timeout >= 0)
curl_easy_setopt (wp->curl, CURLOPT_TIMEOUT_MS, (long) wp->timeout);
else
curl_easy_setopt (wp->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int cc_page_init_curl */
if (db->post_body != NULL)
curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else if (db->interval > 0)
else
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int cj_init_curl */
if (db->post_body != NULL)
curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int cx_init_curl */
curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
}
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (timeout != NULL)
{
curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atol(timeout));
curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
}
+#endif
return (0);
} /* void init */
(long) cb->low_speed_time);
}
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (cb->timeout > 0)
curl_easy_setopt (cb->curl, CURLOPT_TIMEOUT_MS, (long) cb->timeout);
+#endif
curl_easy_setopt (cb->curl, CURLOPT_NOSIGNAL, 1L);
curl_easy_setopt (cb->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT);