mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Fixed falling out of the network monitor thread if the ZeroTier service isn't running on Windows
This commit is contained in:
parent
b9c1407013
commit
8c30b2b9f5
2 changed files with 13 additions and 7 deletions
|
@ -188,7 +188,8 @@ namespace WinUI
|
||||||
}
|
}
|
||||||
catch (System.Net.WebException e)
|
catch (System.Net.WebException e)
|
||||||
{
|
{
|
||||||
if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized)
|
HttpWebResponse res = (HttpWebResponse)e.Response;
|
||||||
|
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
APIHandler.initHandler(true);
|
APIHandler.initHandler(true);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +252,8 @@ namespace WinUI
|
||||||
}
|
}
|
||||||
catch (System.Net.WebException e)
|
catch (System.Net.WebException e)
|
||||||
{
|
{
|
||||||
if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized)
|
HttpWebResponse res = (HttpWebResponse)e.Response;
|
||||||
|
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
APIHandler.initHandler(true);
|
APIHandler.initHandler(true);
|
||||||
}
|
}
|
||||||
|
@ -310,7 +312,8 @@ namespace WinUI
|
||||||
}
|
}
|
||||||
catch (System.Net.WebException e)
|
catch (System.Net.WebException e)
|
||||||
{
|
{
|
||||||
if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized)
|
HttpWebResponse res = (HttpWebResponse)e.Response;
|
||||||
|
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
APIHandler.initHandler(true);
|
APIHandler.initHandler(true);
|
||||||
}
|
}
|
||||||
|
@ -348,7 +351,8 @@ namespace WinUI
|
||||||
}
|
}
|
||||||
catch (System.Net.WebException e)
|
catch (System.Net.WebException e)
|
||||||
{
|
{
|
||||||
if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized)
|
HttpWebResponse res = (HttpWebResponse)e.Response;
|
||||||
|
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
APIHandler.initHandler(true);
|
APIHandler.initHandler(true);
|
||||||
}
|
}
|
||||||
|
@ -405,7 +409,8 @@ namespace WinUI
|
||||||
}
|
}
|
||||||
catch (System.Net.WebException e)
|
catch (System.Net.WebException e)
|
||||||
{
|
{
|
||||||
if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized)
|
HttpWebResponse res = (HttpWebResponse)e.Response;
|
||||||
|
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
APIHandler.initHandler(true);
|
APIHandler.initHandler(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,10 +152,11 @@ namespace WinUI
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Monitor Thread Ended");
|
Console.WriteLine("Monitor Thread Exception: " + "\n" + e.StackTrace);
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("Monitor Thread Ended");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SubscribeStatusUpdates(StatusCallback cb)
|
public void SubscribeStatusUpdates(StatusCallback cb)
|
||||||
|
|
Loading…
Add table
Reference in a new issue