From ad9b0046d974b04b9dc46c8c81ab8b1cbcc9fec3 Mon Sep 17 00:00:00 2001 From: z3APA3A <3APA3A@3proxy.ru> Date: Fri, 19 Feb 2016 20:21:16 +0300 Subject: [PATCH] Fix thread init bug introduced --- src/common.c | 2 +- src/proxymain.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common.c b/src/common.c index 96cb5d8..81c369d 100644 --- a/src/common.c +++ b/src/common.c @@ -61,7 +61,7 @@ struct extparam conf = { #ifdef __FreeBSD__ 16384, #else - 0 + 0, #endif 0, -1, 0, 0, 0, 0, 0, 500, 0, 0, 0, 6, 600, diff --git a/src/proxymain.c b/src/proxymain.c index d310958..442edd9 100644 --- a/src/proxymain.c +++ b/src/proxymain.c @@ -401,9 +401,6 @@ int MODULEMAINFUNC (int argc, char** argv){ return((*srv.pf)((void *)newparam)? 1:0); } - pthread_attr_init(&pa); - pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (8192 + srv.stacksize)); - pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED); #endif @@ -509,6 +506,11 @@ int MODULEMAINFUNC (int argc, char** argv){ srv.fds.fd = sock; srv.fds.events = POLLIN; +#ifndef _WIN32 + pthread_attr_init(&pa); + pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (8192 + srv.stacksize)); + pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED); +#endif for (;;) { for(;;){