From f027201679ca81e25024315b9ed7e2afeafa8116 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 8 May 2008 10:17:03 +0200 Subject: bugfix: gtls netstram driver did not specify threading model (could possibly lead to "interesting effects" ;)) --- runtime/nsd_gtls.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index a346118b..bd97254d 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include "rsyslog.h" #include "syslogd-types.h" @@ -43,6 +45,7 @@ #define CRLFILE "crl.pem" +GCRY_THREAD_OPTION_PTHREAD_IMPL; MODULE_TYPE_LIB /* static data */ @@ -90,6 +93,8 @@ gtlsGlblInit(void) uchar *cafile; DEFiRet; + /* gcry_control must be called first, so that the thread system is correctly set up */ + gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); CHKgnutls(gnutls_global_init()); /* X509 stuff */ @@ -267,7 +272,7 @@ SetMode(nsd_t *pNsd, int mode) DEFiRet; nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd; -dbgprintf("SetMOde tries to set mode %d\n", mode); +dbgprintf("SetMode tries to set mode %d\n", mode); ISOBJ_TYPE_assert((pThis), nsd_gtls); if(mode != 0 && mode != 1) ABORT_FINALIZE(RS_RET_INVAID_DRVR_MODE); @@ -351,8 +356,7 @@ GetRemoteHName(nsd_t *pNsd, uchar **ppszHName) /* get the remote host's IP address. The returned string must be freed by the - * caller. - * rgerhards, 2008-04-25 + * caller. -- rgerhards, 2008-04-25 */ static rsRetVal GetRemoteIP(nsd_t *pNsd, uchar **ppszIP) -- cgit