projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74d6bcc
)
write_stackdriver plugin: Set HTTP request timeout.
author
Florian Forster
<octo@collectd.org>
Tue, 9 Oct 2018 07:06:28 +0000
(09:06 +0200)
committer
Florian Forster
<octo@collectd.org>
Tue, 9 Oct 2018 07:06:28 +0000
(09:06 +0200)
src/write_stackdriver.c
patch
|
blob
|
history
diff --git
a/src/write_stackdriver.c
b/src/write_stackdriver.c
index
eb60ea9
..
7be3c67
100644
(file)
--- a/
src/write_stackdriver.c
+++ b/
src/write_stackdriver.c
@@
-187,6
+187,12
@@
static int do_post(wg_callback_t *cb, char const *url, void const *payload,
curl_easy_setopt(cb->curl, CURLOPT_POST, 1L);
curl_easy_setopt(cb->curl, CURLOPT_URL, url);
+ long timeout_ms = 2 * CDTIME_T_TO_MS(plugin_get_interval());
+ if (timeout_ms < 10000) {
+ timeout_ms = 10000;
+ }
+ curl_easy_setopt(cb->curl, CURLOPT_TIMEOUT_MS, timeout_ms);
+
/* header */
char *auth_header = wg_get_authorization_header(cb);
if (auth_header == NULL) {