From: Cyril Feraudet Date: Mon, 19 Mar 2012 10:08:06 +0000 (+0100) Subject: Proposal fix for large "MaxPacketSize" use. X-Git-Tag: collectd-4.10.7~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=12213f8dfeee3feb3846aa658def0bb79c1211d0;p=collectd.git Proposal fix for large "MaxPacketSize" use. 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. --- diff --git a/src/network.c b/src/network.c index 06cc2c50..f7f47c7a 100644 --- a/src/network.c +++ b/src/network.c @@ -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 (); }