projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9870ddc
)
http plugin: Use the `FORMAT_VL' macro.
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
60535ba
..
8add24b
100644
(file)
--- a/
src/http.c
+++ b/
src/http.c
@@
-257,7
+257,6
@@
static int http_flush_buffer (void) /* {{{ */
static int http_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
user_data_t __attribute__((unused)) *user_data)
{
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];
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;
}
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 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);
if (status != 0) {
ERROR ("http plugin: error with http_value_list_to_string");
return (status);
@@
-286,9
+282,11
@@
static int http_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
pthread_mutex_lock (&send_lock);
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)))
send_buffer_fill += status;
if ((sizeof (send_buffer) - send_buffer_fill) < (sizeof(key) + sizeof(values)))