Code

network plugin: “sizeof (send_buffer)” → “network_config_packet_size”.
authorAman Gupta <aman@tmm1.net>
Sat, 29 Aug 2009 20:11:27 +0000 (22:11 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 29 Aug 2009 20:11:27 +0000 (22:11 +0200)
Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
src/network.c

index 9f3cfd3ba1b66ca8b6f81f42519adf941dc2a87b..92271b786cd52dc5960c7cdf493a237177e1544f 100644 (file)
@@ -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 ();
        }