Code

write_graphite: Decrease a buffer size.
authorFlorian Forster <octo@collectd.org>
Wed, 16 Jan 2013 12:18:32 +0000 (13:18 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 16 Jan 2013 12:18:32 +0000 (13:18 +0100)
If the buffer is too large, it is possible that the message cannot be
send using the send buffer, leading to a failed assertion in
wg_send_message().

Fixes Github issue #226. Thanks to @bwhaley for reporting this.

src/write_graphite.c

index 2ae30efe2ca179b0fd13cfafe5914f5a031b14ff..4eb0025ea0e1ab837b349345435a8507549b5c48 100644 (file)
@@ -340,7 +340,7 @@ static int wg_send_message (char const *message, struct wg_callback *cb)
 static int wg_write_messages (const data_set_t *ds, const value_list_t *vl,
         struct wg_callback *cb)
 {
-    char buffer[4096];
+    char buffer[WG_SEND_BUF_SIZE];
     int status;
 
     if (0 != strcmp (ds->type, vl->type))