summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9870ddc)
raw | patch | inline | side by side (parent: 9870ddc)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 21 Aug 2009 08:23:30 +0000 (10:23 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 21 Aug 2009 08:23:30 +0000 (10:23 +0200) |
src/http.c | patch | blob | history |
diff --git a/src/http.c b/src/http.c
index 60535ba87f175871fdda7b49f74db0b2111b6c4d..8add24b3366661d524479aa583558dff36500756 100644 (file)
--- a/src/http.c
+++ b/src/http.c
static int http_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
user_data_t __attribute__((unused)) *user_data)
{
-
char key[1024];
char values[512];
@@ -268,16 +267,13 @@ static int http_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
return -1;
}
- status = format_name( key, sizeof(key), vl->host, vl->plugin,
- vl->plugin_instance, vl->type, vl->type_instance );
-
+ status = FORMAT_VL (key, sizeof (key), vl);
if (status != 0) {
ERROR ("http plugin: error with format_name");
return (status);
}
status = http_value_list_to_string (values, sizeof (values), ds, vl);
-
if (status != 0) {
ERROR ("http plugin: error with http_value_list_to_string");
return (status);
pthread_mutex_lock (&send_lock);
- status = ssnprintf (send_buffer + send_buffer_fill, sizeof (send_buffer) - send_buffer_fill,
- "PUTVAL %s interval=%i %u%s\n",
- key, interval_g, vl->time, values);
+ /* `values' has a leading `:'. */
+ status = ssnprintf (send_buffer + send_buffer_fill,
+ sizeof (send_buffer) - send_buffer_fill,
+ "PUTVAL %s interval=%i %lu%s\n",
+ key, interval_g, (unsigned long) vl->time, values);
send_buffer_fill += status;
if ((sizeof (send_buffer) - send_buffer_fill) < (sizeof(key) + sizeof(values)))