mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 21:13:44 +02:00
GitHub issue #1019
This commit is contained in:
parent
3c0f54257b
commit
27c8eb0d6d
3 changed files with 25 additions and 7 deletions
|
@ -113,7 +113,20 @@
|
||||||
<ClCompile Include="..\..\service\SoftwareUpdater.cpp" />
|
<ClCompile Include="..\..\service\SoftwareUpdater.cpp" />
|
||||||
<ClCompile Include="ServiceBase.cpp" />
|
<ClCompile Include="ServiceBase.cpp" />
|
||||||
<ClCompile Include="ServiceInstaller.cpp" />
|
<ClCompile Include="ServiceInstaller.cpp" />
|
||||||
<ClCompile Include="ZeroTierOneService.cpp" />
|
<ClCompile Include="ZeroTierOneService.cpp">
|
||||||
|
<FunctionLevelLinking Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</FunctionLevelLinking>
|
||||||
|
<EnableParallelCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EnableParallelCodeGeneration>
|
||||||
|
<FunctionLevelLinking Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</FunctionLevelLinking>
|
||||||
|
<EnableParallelCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</EnableParallelCodeGeneration>
|
||||||
|
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||||
|
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NoExtensions</EnableEnhancedInstructionSet>
|
||||||
|
<FloatingPointExceptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</FloatingPointExceptions>
|
||||||
|
<CreateHotpatchableImage Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CreateHotpatchableImage>
|
||||||
|
<FloatingPointExceptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</FloatingPointExceptions>
|
||||||
|
<CreateHotpatchableImage Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CreateHotpatchableImage>
|
||||||
|
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||||
|
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NoExtensions</EnableEnhancedInstructionSet>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\controller\DB.hpp" />
|
<ClInclude Include="..\..\controller\DB.hpp" />
|
||||||
|
|
|
@ -76,9 +76,7 @@ restart_node:
|
||||||
ZeroTier::Mutex::Lock _l(_lock);
|
ZeroTier::Mutex::Lock _l(_lock);
|
||||||
delete _service;
|
delete _service;
|
||||||
_service = (ZeroTier::OneService *)0; // in case newInstance() fails
|
_service = (ZeroTier::OneService *)0; // in case newInstance() fails
|
||||||
_service = ZeroTier::OneService::newInstance(
|
_service = ZeroTier::OneService::newInstance(_path.c_str(), ZT_DEFAULT_PORT);
|
||||||
ZeroTier::OneService::platformDefaultHomePath().c_str(),
|
|
||||||
ZT_DEFAULT_PORT);
|
|
||||||
}
|
}
|
||||||
switch(_service->run()) {
|
switch(_service->run()) {
|
||||||
case ZeroTier::OneService::ONE_UNRECOVERABLE_ERROR: {
|
case ZeroTier::OneService::ONE_UNRECOVERABLE_ERROR: {
|
||||||
|
@ -120,10 +118,16 @@ restart_node:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZeroTierOneService::OnStart(DWORD dwArgc, LPSTR *lpszArgv)
|
void ZeroTierOneService::OnStart(DWORD dwArgc, PSTR *lpszArgv)
|
||||||
{
|
{
|
||||||
ZT_SVCDBG("ZeroTierOneService::OnStart()\r\n");
|
ZT_SVCDBG("ZeroTierOneService::OnStart()\r\n");
|
||||||
|
|
||||||
|
if ((dwArgc > 1)&&(lpszArgv[1])&&(strlen(lpszArgv[1]) > 0)) {
|
||||||
|
this->_path = lpszArgv[1];
|
||||||
|
} else {
|
||||||
|
this->_path = ZeroTier::OneService::platformDefaultHomePath();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_thread = ZeroTier::Thread::start(this);
|
_thread = ZeroTier::Thread::start(this);
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
|
|
@ -57,11 +57,12 @@ public:
|
||||||
throw();
|
throw();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
|
virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
|
||||||
virtual void OnStop();
|
virtual void OnStop();
|
||||||
virtual void OnShutdown();
|
virtual void OnShutdown();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string _path;
|
||||||
ZeroTier::OneService *volatile _service;
|
ZeroTier::OneService *volatile _service;
|
||||||
ZeroTier::Mutex _lock;
|
ZeroTier::Mutex _lock;
|
||||||
ZeroTier::Thread _thread;
|
ZeroTier::Thread _thread;
|
||||||
|
|
Loading…
Add table
Reference in a new issue