Code

Proposal fix for large "MaxPacketSize" use.
authorCyril Feraudet <cyril@feraudet.com>
Mon, 19 Mar 2012 10:08:06 +0000 (11:08 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 21 Mar 2012 17:15:52 +0000 (18:15 +0100)
When we use a "MaxPacketSize" over two thousand of octets (to pass huge
message in notification for example), buffer may not be flushed for a
while.
By flushing buffer when there is about 1400 octets, we're sure there is
no data too longer in.

src/network.c

index 06cc2c5012554dfae90be5c2c8411574cb3039ba..f7f47c7ac4a6d2086f368463b1a13f11bcd60c1d 100644 (file)
@@ -2715,7 +2715,7 @@ static int network_write (const data_set_t *ds, const value_list_t *vl,
                ERROR ("network plugin: Unable to append to the "
                                "buffer for some weird reason");
        }
-       else if ((network_config_packet_size - send_buffer_fill) < 15)
+       else if (send_buffer_fill >= 1452 - 15)
        {
                flush_buffer ();
        }