projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3339 from jkohen/patch-1
[collectd.git]
/
src
/
write_stackdriver.c
diff --git
a/src/write_stackdriver.c
b/src/write_stackdriver.c
index
a1341d9
..
dfa1d7c
100644
(file)
--- a/
src/write_stackdriver.c
+++ b/
src/write_stackdriver.c
@@
-22,12
+22,12
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "configfile.h"
#include "plugin.h"
#include "configfile.h"
#include "plugin.h"
-#include "utils_format_stackdriver.h"
-#include "utils_gce.h"
-#include "utils_oauth.h"
+#include "utils/common/common.h"
+#include "utils/format_stackdriver/format_stackdriver.h"
+#include "utils/gce/gce.h"
+#include "utils/oauth/oauth.h"
#include <curl/curl.h>
#include <pthread.h>
#include <curl/curl.h>
#include <pthread.h>
@@
-109,8
+109,8
@@
static char *wg_get_authorization_header(wg_callback_t *cb) { /* {{{ */
return NULL;
}
return NULL;
}
- status = snprintf(authorization_header, sizeof(authorization_header),
- "Authorization: Bearer %s", access_token);
+ status = s
s
nprintf(authorization_header, sizeof(authorization_header),
+
"Authorization: Bearer %s", access_token);
if ((status < 1) || ((size_t)status >= sizeof(authorization_header)))
return NULL;
if ((status < 1) || ((size_t)status >= sizeof(authorization_header)))
return NULL;
@@
-160,9
+160,9
@@
static char *api_error_string(api_error_t *err, char *buffer,
if (err == NULL) {
strncpy(buffer, "Unknown error (API error is NULL)", buffer_size);
} else if (err->message == NULL) {
if (err == NULL) {
strncpy(buffer, "Unknown error (API error is NULL)", buffer_size);
} else if (err->message == NULL) {
- snprintf(buffer, buffer_size, "API error %d", err->code);
+ s
s
nprintf(buffer, buffer_size, "API error %d", err->code);
} else {
} else {
- snprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message);
+ s
s
nprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message);
}
return buffer;
}
return buffer;
@@
-251,8
+251,8
@@
static int do_post(wg_callback_t *cb, char const *url, void const *payload,
static int wg_call_metricdescriptor_create(wg_callback_t *cb,
char const *payload) {
char url[1024];
static int wg_call_metricdescriptor_create(wg_callback_t *cb,
char const *payload) {
char url[1024];
- snprintf(url, sizeof(url), "%s/projects/%s/metricDescriptors", cb->url,
- cb->project);
+ s
s
nprintf(url, sizeof(url), "%s/projects/%s/metricDescriptors", cb->url,
+
cb->project);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);
@@
-273,7
+273,8
@@
static int wg_call_metricdescriptor_create(wg_callback_t *cb,
static int wg_call_timeseries_write(wg_callback_t *cb, char const *payload) {
char url[1024];
static int wg_call_timeseries_write(wg_callback_t *cb, char const *payload) {
char url[1024];
- snprintf(url, sizeof(url), "%s/projects/%s/timeSeries", cb->url, cb->project);
+ ssnprintf(url, sizeof(url), "%s/projects/%s/timeSeries", cb->url,
+ cb->project);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);