X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetwork.c;h=ac6925468096f46d82627ff797353a4cb1168b5b;hb=8be9c73cc216609a54a1b997aad8a3d646a0a43f;hp=92271b786cd52dc5960c7cdf493a237177e1544f;hpb=daaa677b7b077a0de6b0b7f12c1f3c56f93654e1;p=collectd.git diff --git a/src/network.c b/src/network.c index 92271b78..ac692546 100644 --- a/src/network.c +++ b/src/network.c @@ -1,22 +1,25 @@ /** * collectd - src/network.c * Copyright (C) 2005-2009 Florian octo Forster + * Copyright (C) 2009 Aman Gupta * * 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 + * Aman Gupta **/ #define _BSD_SOURCE /* For struct ip_mreq */ @@ -52,6 +55,7 @@ #if HAVE_LIBGCRYPT # include +GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif #ifndef IPV6_ADD_MEMBERSHIP @@ -2934,6 +2938,12 @@ static int network_init (void) return (0); have_init = true; +#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); send_buffer = malloc (network_config_packet_size);