network plugin: Change the license to LGPL 2.1.
[collectd.git] / src / network.c
index 0a74a19..a009551 100644 (file)
@@ -3,17 +3,18 @@
  * Copyright (C) 2005-2009  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; only version 2 of the License is applicable.
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; only version 2.1 of the License is
+ * applicable.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  * Authors:
  *   Florian octo Forster <octo at verplant.org>
@@ -51,6 +52,7 @@
 
 #if HAVE_LIBGCRYPT
 # include <gcrypt.h>
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
 
 /* 1500 - 40 - 8  =  Ethernet packet - IPv6 header - UDP header */
@@ -2768,7 +2770,7 @@ static int network_config_set_cache_flush (const oconfig_item_t *ci) /* {{{ */
 
   tmp = (int) ci->values[0].value.number;
   if (tmp > 0)
-    network_config_ttl = tmp;
+    cache_flush_interval = tmp;
 
   return (0);
 } /* }}} int network_config_set_cache_flush */
@@ -2937,6 +2939,12 @@ static int network_init (void)
        if (cache_flush_last != 0)
                return (0);
 
+#if HAVE_LIBGCRYPT
+       gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+       gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0);
+       gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+#endif
+
        plugin_register_shutdown ("network", network_shutdown);
 
        network_init_buffer ();