summaryrefslogtreecommitdiffstats
path: root/PICA_nodewait.c
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-03 12:30:27 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-03 12:30:27 +0000
commita48ea77194fc5c74ce8cbe13536975a8ebce1b0b (patch)
treee2eb46eef5dd230915305050c69bbe0b8961d98c /PICA_nodewait.c
parente81efe9708f5f6c34ed87335b0176a0b734e9e5a (diff)
downloadpica-pica-a48ea77194fc5c74ce8cbe13536975a8ebce1b0b.tar.gz
pica-pica-a48ea77194fc5c74ce8cbe13536975a8ebce1b0b.zip
removed calls to log functions from nodewait_resolve_thread() and nodewait_connect_thread(), log functions are not thread safe, calling them caused segfaults
git-svn-id: svn://localhost/project_picapica/trunk@256 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'PICA_nodewait.c')
-rw-r--r--PICA_nodewait.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/PICA_nodewait.c b/PICA_nodewait.c
index 6a9a70c..db9df81 100644
--- a/PICA_nodewait.c
+++ b/PICA_nodewait.c
@@ -72,6 +72,9 @@ static DWORD WINAPI nodewait_resolve_thread (void *arg)
static void *nodewait_resolve_thread (void *arg)
#endif
{
+/*
+* DO NOT CALL LOGGING FUNCTIONS HERE, THEY ARE NOT THREAD-SAFE
+*/
struct nodewait *nw = (struct nodewait *)arg;
struct addrinfo h;
char portbuf[8];
@@ -110,6 +113,9 @@ static DWORD WINAPI nodewait_connect_thread (void *arg)
static void *nodewait_connect_thread (void *arg)
#endif
{
+/*
+* DO NOT CALL LOGGING FUNCTIONS HERE, THEY ARE NOT THREAD-SAFE
+*/
struct nodewait *nw = (struct nodewait *)arg;
struct addrinfo *ap;
@@ -126,16 +132,11 @@ while(ap)
continue;
}
- PICA_debug2("created socket %i", nw->nc.sck);
-
if (0 != connect(nw->nc.sck,ap->ai_addr,ap->ai_addrlen))
{
ap=ap->ai_next;
-
- PICA_debug2("connect() failed: %s", strerror(errno));
CLOSE(nw->nc.sck);
- PICA_debug2("closed socket %i", nw->nc.sck);
continue;
}
else