summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fae7c4b)
raw | patch | inline | side by side (parent: fae7c4b)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 6 Jun 2007 12:30:12 +0000 (14:30 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 6 Jun 2007 12:30:12 +0000 (14:30 +0200) |
src/network.c | patch | blob | history | |
src/network.h | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index 34385bf66d106be5ebda3cf92a3ae88ad9d2adb6..ad8d530e4780d4ff9ce8ab96d72b65455a243c42 100644 (file)
--- a/src/network.c
+++ b/src/network.c
static char send_buffer[BUFF_SIZE];
static char *send_buffer_ptr;
static int send_buffer_fill;
-static value_list_t send_buffer_vl = VALUE_LIST_INIT;
+static value_list_t send_buffer_vl = VALUE_LIST_STATIC;
static char send_buffer_type[DATA_MAX_NAME_LEN];
static pthread_mutex_t send_buffer_lock = PTHREAD_MUTEX_INITIALIZER;
if (status == 0)
vl.time = (time_t) tmp;
}
+ else if (ntohs (header->type) == TYPE_INTERVAL)
+ {
+ uint64_t tmp = 0;
+ status = parse_part_number (&buffer, &buffer_len, &tmp);
+ if (status == 0)
+ vl.interval = (int) tmp;
+ }
else if (ntohs (header->type) == TYPE_HOST)
{
status = parse_part_string (&buffer, &buffer_len,
(unsigned int) vl->time);
}
+ if (vl_def->interval != vl->interval)
+ {
+ if (write_part_number (&buffer, &buffer_size, TYPE_INTERVAL,
+ (uint64_t) vl->interval))
+ return (-1);
+ vl_def->interval = vl->interval;
+ DEBUG ("network plugin: add_to_buffer: interval = %i",
+ (int) vl->interval);
+ }
+
if (strcmp (vl_def->plugin, vl->plugin) != 0)
{
if (write_part_string (&buffer, &buffer_size, TYPE_PLUGIN,
diff --git a/src/network.h b/src/network.h
index b20fc75f837a8f9992aa5e4e1f5f1183e90e9a6d..6d8e966e967d68749e0ad5bc5a4f25662c8b074e 100644 (file)
--- a/src/network.h
+++ b/src/network.h
#define TYPE_TYPE 0x0004
#define TYPE_TYPE_INSTANCE 0x0005
#define TYPE_VALUES 0x0006
+#define TYPE_INTERVAL 0x0007
#endif /* NETWORK_H */