From de4e29288d30183ca78a5e0878431ed47fa58b8f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 21 Aug 2014 17:49:05 -0700 Subject: Fix for crazy Windows threading bug... repeatedly adding and removing a network now doesn't leave networks in limbo. --- main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index f9c8645f..9743a74d 100644 --- a/main.cpp +++ b/main.cpp @@ -25,6 +25,10 @@ * LLC. Start here: http://www.zerotier.com/ */ +// Uncomment on Windows to assume -C and run in console instead of service +// Useful for Visual Studio debugging (launch VS as Administrator to run) +#define ZT_WIN_RUN_IN_CONSOLE + #include #include #include @@ -586,12 +590,18 @@ int main(int argc,char **argv) const char *homeDir = (const char *)0; unsigned int udpPort = ZT_DEFAULT_UDP_PORT; unsigned int tcpPort = 0; + #ifdef __UNIX_LIKE__ bool runAsDaemon = false; #endif #ifdef __WINDOWS__ +#ifdef ZT_WIN_RUN_IN_CONSOLE + bool winRunFromCommandLine = true; +#else bool winRunFromCommandLine = false; #endif +#endif // __WINDOWS__ + for(int i=1;i