From 417be5562c6f0c873d14b5a467b73c484df472b1 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Sat, 29 Aug 2009 22:11:27 +0200 Subject: [PATCH] =?utf8?q?network=20plugin:=20=E2=80=9Csizeof=20(send=5Fbu?= =?utf8?q?ffer)=E2=80=9D=20=E2=86=92=20=E2=80=9Cnetwork=5Fconfig=5Fpacket?= =?utf8?q?=5Fsize=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Florian Forster --- src/network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network.c b/src/network.c index 9f3cfd3b..92271b78 100644 --- a/src/network.c +++ b/src/network.c @@ -2133,7 +2133,7 @@ static void *receive_thread (void __attribute__((unused)) *arg) static void network_init_buffer (void) { - memset (send_buffer, 0, sizeof (send_buffer)); + memset (send_buffer, 0, network_config_packet_size); send_buffer_ptr = send_buffer; send_buffer_fill = 0; @@ -2452,7 +2452,7 @@ static int network_write (const data_set_t *ds, const value_list_t *vl, pthread_mutex_lock (&send_buffer_lock); status = add_to_buffer (send_buffer_ptr, - sizeof (send_buffer) - (send_buffer_fill + BUFF_SIG_SIZE), + network_config_packet_size - (send_buffer_fill + BUFF_SIG_SIZE), &send_buffer_vl, ds, vl); if (status >= 0) @@ -2466,7 +2466,7 @@ static int network_write (const data_set_t *ds, const value_list_t *vl, flush_buffer (); status = add_to_buffer (send_buffer_ptr, - sizeof (send_buffer) - (send_buffer_fill + BUFF_SIG_SIZE), + network_config_packet_size - (send_buffer_fill + BUFF_SIG_SIZE), &send_buffer_vl, ds, vl); @@ -2482,7 +2482,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 ((sizeof (send_buffer) - send_buffer_fill) < 15) + else if ((network_config_packet_size - send_buffer_fill) < 15) { flush_buffer (); } -- 2.30.2