From: Aman Gupta Date: Sat, 29 Aug 2009 20:11:27 +0000 (+0200) Subject: network plugin: “sizeof (send_buffer)” → “network_config_packet_size”. X-Git-Tag: collectd-4.8.0~25 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=417be5562c6f0c873d14b5a467b73c484df472b1;p=collectd.git network plugin: “sizeof (send_buffer)” → “network_config_packet_size”. Signed-off-by: Florian Forster --- 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 (); }