write_kafka: 'rd_kafka_errno2err' is deprecated, fix failed builds
[collectd.git] / src / network.c
index 2ff09af..e28316d 100644 (file)
@@ -292,7 +292,7 @@ static char *send_buffer;
 static char *send_buffer_ptr;
 static int send_buffer_fill;
 static cdtime_t send_buffer_last_update;
-static value_list_t send_buffer_vl = VALUE_LIST_STATIC;
+static value_list_t send_buffer_vl = VALUE_LIST_INIT;
 static pthread_mutex_t send_buffer_lock = PTHREAD_MUTEX_INITIALIZER;
 
 /* XXX: These counters are incremented from one place only. The spot in which
@@ -1230,9 +1230,9 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
                             part_size - buffer_offset,
                             /* in = */ NULL, /* in len = */ 0);
   if (err != 0) {
-    sfree(pea.username);
     ERROR("network plugin: gcry_cipher_decrypt returned: %s. Username: %s",
           gcry_strerror(err), pea.username);
+    sfree(pea.username);
     return (-1);
   }
 
@@ -1254,8 +1254,6 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
   parse_packet(se, buffer + buffer_offset, payload_len, flags | PP_ENCRYPTED,
                pea.username);
 
-  /* XXX: Free pea.username?!? */
-
   /* Update return values */
   *ret_buffer = buffer + part_size;
   *ret_buffer_len = buffer_len - part_size;
@@ -3086,7 +3084,6 @@ static int network_stats_read(void) /* {{{ */
   vl.values = values;
   vl.values_len = 2;
   vl.time = 0;
-  sstrncpy(vl.host, hostname_g, sizeof(vl.host));
   sstrncpy(vl.plugin, "network", sizeof(vl.plugin));
 
   /* Octets received / sent */
@@ -3167,7 +3164,8 @@ static int network_init(void) {
   if (dispatch_thread_running == 0) {
     int status;
     status = plugin_thread_create(&dispatch_thread_id, NULL /* no attributes */,
-                                  dispatch_thread, NULL /* no argument */);
+                                  dispatch_thread, NULL /* no argument */,
+                                  "network disp");
     if (status != 0) {
       char errbuf[1024];
       ERROR("network: pthread_create failed: %s",
@@ -3180,7 +3178,8 @@ static int network_init(void) {
   if (receive_thread_running == 0) {
     int status;
     status = plugin_thread_create(&receive_thread_id, NULL /* no attributes */,
-                                  receive_thread, NULL /* no argument */);
+                                  receive_thread, NULL /* no argument */,
+                                  "network recv");
     if (status != 0) {
       char errbuf[1024];
       ERROR("network: pthread_create failed: %s",