From 12213f8dfeee3feb3846aa658def0bb79c1211d0 Mon Sep 17 00:00:00 2001 From: Cyril Feraudet Date: Mon, 19 Mar 2012 11:08:06 +0100 Subject: [PATCH] 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. --- src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 (); } -- 2.30.2