projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Thread safe yaz_init_globals
[yaz-moved-to-github.git]
/
src
/
tcpip.c
diff --git
a/src/tcpip.c
b/src/tcpip.c
index
64942ae
..
57f15af
100644
(file)
--- a/
src/tcpip.c
+++ b/
src/tcpip.c
@@
-134,10
+134,13
@@
typedef struct tcpip_state
int connect_response_len;
} tcpip_state;
int connect_response_len;
} tcpip_state;
-#ifdef WIN32
static int tcpip_init(void)
{
static int tcpip_init(void)
{
+#ifdef WIN32
static int initialized = 0;
static int initialized = 0;
+#endif
+ yaz_init_globals();
+#ifdef WIN32
if (!initialized)
{
WORD requested;
if (!initialized)
{
WORD requested;
@@
-148,14
+151,9
@@
static int tcpip_init(void)
return 0;
initialized = 1;
}
return 0;
initialized = 1;
}
+#endif
return 1;
}
return 1;
}
-#else
-static int tcpip_init(void)
-{
- return 1;
-}
-#endif
/*
* This function is always called through the cs_create() macro.
/*
* This function is always called through the cs_create() macro.
@@
-572,7
+570,6
@@
int tcpip_rcvconnect(COMSTACK h)
#if HAVE_GNUTLS_H
if (h->type == ssl_type && !sp->session)
{
#if HAVE_GNUTLS_H
if (h->type == ssl_type && !sp->session)
{
- gnutls_global_init();
tcpip_create_cred(h);
gnutls_init(&sp->session, GNUTLS_CLIENT);
gnutls_set_default_priority(sp->session);
tcpip_create_cred(h);
gnutls_init(&sp->session, GNUTLS_CLIENT);
gnutls_set_default_priority(sp->session);