diff --git a/Pub/PublishApps.ps1 b/Pub/PublishApps.ps1 index 3a9f080ca..8fe2fc692 100644 --- a/Pub/PublishApps.ps1 +++ b/Pub/PublishApps.ps1 @@ -6,7 +6,6 @@ param( [Parameter(Mandatory=$true)][object]$connectWin, [Parameter(Mandatory=$true)][object]$connectAndroid, [Parameter(Mandatory=$true)][object]$maui, - [Parameter(Mandatory=$true)][object]$server, [Parameter(Mandatory=$true)][object]$distribute, [Parameter(Mandatory=$true)][object]$samples ); @@ -17,7 +16,6 @@ $connectAndroid = $connectAndroid -eq "1"; $clientWin = $clientWin -eq "1"; $clientAndroid = $clientAndroid -eq "1"; $distribute = $distribute -eq "1"; -$server = $server -eq "1"; $samples = $samples -eq "1"; $maui = $maui -eq "1"; @@ -69,14 +67,6 @@ if ($clientWin) { & "$solutionDir/Src/Apps/Client.Win.Web/_publish.ps1"; } -# publish server -if ($server) { - & "$solutionDir/Src/Apps/Server.Net/Pub/publish_win.ps1"; - & "$solutionDir/Src/Apps/Server.Net/Pub/publish_linux_x64.ps1"; - & "$solutionDir/Src/Apps/Server.Net/Pub/publish_linux_arm64.ps1"; - & "$solutionDir/Src/Apps/Server.Net/Pub/publish_docker.ps1" -distribute $distribute; -} - # publish android if ($clientAndroid) { & "$solutionDir/Src/Apps/Client.Android.Google/_publish.ps1"; @@ -93,7 +83,7 @@ if ($connectAndroid) { # distribute if ($distribute) { & "$PSScriptRoot/PublishToGitHub.ps1" ` - -mainRepo ($clientWin -or $clientAndroid -or $server) ` + -mainRepo ($clientWin -or $clientAndroid) ` -connectRepo ($connectWin -or $connectAndroid); } diff --git a/Src/AppLib/VpnHood.AppLib.Abstractions/VpnHood.AppLib.Abstractions.csproj b/Src/AppLib/VpnHood.AppLib.Abstractions/VpnHood.AppLib.Abstractions.csproj index 930e9b9ab..783c968d6 100644 --- a/Src/AppLib/VpnHood.AppLib.Abstractions/VpnHood.AppLib.Abstractions.csproj +++ b/Src/AppLib/VpnHood.AppLib.Abstractions/VpnHood.AppLib.Abstractions.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Android.Ads.AdMob/VpnHood.AppLib.Android.Ads.AdMob.csproj b/Src/AppLib/VpnHood.AppLib.Android.Ads.AdMob/VpnHood.AppLib.Android.Ads.AdMob.csproj index f8b4859d6..91e87fd43 100644 --- a/Src/AppLib/VpnHood.AppLib.Android.Ads.AdMob/VpnHood.AppLib.Android.Ads.AdMob.csproj +++ b/Src/AppLib/VpnHood.AppLib.Android.Ads.AdMob/VpnHood.AppLib.Android.Ads.AdMob.csproj @@ -21,7 +21,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Android.Common/VpnHood.AppLib.Android.Common.csproj b/Src/AppLib/VpnHood.AppLib.Android.Common/VpnHood.AppLib.Android.Common.csproj index 6d3e1d67a..c4491755c 100644 --- a/Src/AppLib/VpnHood.AppLib.Android.Common/VpnHood.AppLib.Android.Common.csproj +++ b/Src/AppLib/VpnHood.AppLib.Android.Common/VpnHood.AppLib.Android.Common.csproj @@ -21,7 +21,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Android.GooglePlay.Core/VpnHood.AppLib.Android.GooglePlay.Core.csproj b/Src/AppLib/VpnHood.AppLib.Android.GooglePlay.Core/VpnHood.AppLib.Android.GooglePlay.Core.csproj index 709f48c94..9c9455d36 100644 --- a/Src/AppLib/VpnHood.AppLib.Android.GooglePlay.Core/VpnHood.AppLib.Android.GooglePlay.Core.csproj +++ b/Src/AppLib/VpnHood.AppLib.Android.GooglePlay.Core/VpnHood.AppLib.Android.GooglePlay.Core.csproj @@ -21,7 +21,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Android.GooglePlay/VpnHood.AppLib.Android.GooglePlay.csproj b/Src/AppLib/VpnHood.AppLib.Android.GooglePlay/VpnHood.AppLib.Android.GooglePlay.csproj index b6f517f78..695723003 100644 --- a/Src/AppLib/VpnHood.AppLib.Android.GooglePlay/VpnHood.AppLib.Android.GooglePlay.csproj +++ b/Src/AppLib/VpnHood.AppLib.Android.GooglePlay/VpnHood.AppLib.Android.GooglePlay.csproj @@ -21,7 +21,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.App/VpnHood.AppLib.App.csproj b/Src/AppLib/VpnHood.AppLib.App/VpnHood.AppLib.App.csproj index e04e36d53..7cb24446f 100644 --- a/Src/AppLib/VpnHood.AppLib.App/VpnHood.AppLib.App.csproj +++ b/Src/AppLib/VpnHood.AppLib.App/VpnHood.AppLib.App.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Maui.Common/VpnHood.AppLib.Maui.Common.csproj b/Src/AppLib/VpnHood.AppLib.Maui.Common/VpnHood.AppLib.Maui.Common.csproj index e4b023c3e..1b056d575 100644 --- a/Src/AppLib/VpnHood.AppLib.Maui.Common/VpnHood.AppLib.Maui.Common.csproj +++ b/Src/AppLib/VpnHood.AppLib.Maui.Common/VpnHood.AppLib.Maui.Common.csproj @@ -26,7 +26,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Resources/VpnHood.AppLib.Resources.csproj b/Src/AppLib/VpnHood.AppLib.Resources/VpnHood.AppLib.Resources.csproj index f69c1c4e7..3a8fc860e 100644 --- a/Src/AppLib/VpnHood.AppLib.Resources/VpnHood.AppLib.Resources.csproj +++ b/Src/AppLib/VpnHood.AppLib.Resources/VpnHood.AppLib.Resources.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Store/VpnHood.AppLib.Store.csproj b/Src/AppLib/VpnHood.AppLib.Store/VpnHood.AppLib.Store.csproj index 63ded96b4..86287d58e 100644 --- a/Src/AppLib/VpnHood.AppLib.Store/VpnHood.AppLib.Store.csproj +++ b/Src/AppLib/VpnHood.AppLib.Store/VpnHood.AppLib.Store.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.WebServer/VpnHood.AppLib.WebServer.csproj b/Src/AppLib/VpnHood.AppLib.WebServer/VpnHood.AppLib.WebServer.csproj index e3e1aa9ec..43e5b599c 100644 --- a/Src/AppLib/VpnHood.AppLib.WebServer/VpnHood.AppLib.WebServer.csproj +++ b/Src/AppLib/VpnHood.AppLib.WebServer/VpnHood.AppLib.WebServer.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Win.Common.WpfSpa/VpnHood.AppLib.Win.Common.WpfSpa.csproj b/Src/AppLib/VpnHood.AppLib.Win.Common.WpfSpa/VpnHood.AppLib.Win.Common.WpfSpa.csproj index c58c4b026..d8f9ef7d4 100644 --- a/Src/AppLib/VpnHood.AppLib.Win.Common.WpfSpa/VpnHood.AppLib.Win.Common.WpfSpa.csproj +++ b/Src/AppLib/VpnHood.AppLib.Win.Common.WpfSpa/VpnHood.AppLib.Win.Common.WpfSpa.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/AppLib/VpnHood.AppLib.Win.Common/VpnHood.AppLib.Win.Common.csproj b/Src/AppLib/VpnHood.AppLib.Win.Common/VpnHood.AppLib.Win.Common.csproj index fe49e9f7e..60bb34210 100644 --- a/Src/AppLib/VpnHood.AppLib.Win.Common/VpnHood.AppLib.Win.Common.csproj +++ b/Src/AppLib/VpnHood.AppLib.Win.Common/VpnHood.AppLib.Win.Common.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Apps/Client.Android.Google/VpnHood.App.Client.Android.Google.csproj b/Src/Apps/Client.Android.Google/VpnHood.App.Client.Android.Google.csproj index 609e00d81..347cfea79 100644 --- a/Src/Apps/Client.Android.Google/VpnHood.App.Client.Android.Google.csproj +++ b/Src/Apps/Client.Android.Google/VpnHood.App.Client.Android.Google.csproj @@ -5,8 +5,8 @@ VpnHood.App.Client.Droid.Google Exe com.vpnhood.client.android.debug - 621 - 5.0.621 + 629 + 5.0.629 23.0 @@ -32,7 +32,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Apps/Client.Android.Web/VpnHood.App.Client.Android.Web.csproj b/Src/Apps/Client.Android.Web/VpnHood.App.Client.Android.Web.csproj index 24e4a5225..fefa8076c 100644 --- a/Src/Apps/Client.Android.Web/VpnHood.App.Client.Android.Web.csproj +++ b/Src/Apps/Client.Android.Web/VpnHood.App.Client.Android.Web.csproj @@ -5,8 +5,8 @@ VpnHood.App.Client.Droid.Web Exe com.vpnhood.connect.android.web.debug - 621 - 5.0.621 + 629 + 5.0.629 23.0 @@ -32,7 +32,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Apps/Client.Win.Web/VpnHood.App.Client.Win.Web.csproj b/Src/Apps/Client.Win.Web/VpnHood.App.Client.Win.Web.csproj index 914214780..0334b0afb 100644 --- a/Src/Apps/Client.Win.Web/VpnHood.App.Client.Win.Web.csproj +++ b/Src/Apps/Client.Win.Web/VpnHood.App.Client.Win.Web.csproj @@ -28,7 +28,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Apps/Connect.Android.Google/VpnHood.App.Connect.Android.Google.csproj b/Src/Apps/Connect.Android.Google/VpnHood.App.Connect.Android.Google.csproj index 6419d73dc..8414edff6 100644 --- a/Src/Apps/Connect.Android.Google/VpnHood.App.Connect.Android.Google.csproj +++ b/Src/Apps/Connect.Android.Google/VpnHood.App.Connect.Android.Google.csproj @@ -5,8 +5,8 @@ VpnHood.App.Client.Droid.Google Exe com.vpnhood.connect.android - 626 - 5.0.626 + 629 + 5.0.629 24.0 True @@ -36,7 +36,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.626 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Apps/Connect.Win.Web/VpnHood.App.Connect.Win.Web.csproj b/Src/Apps/Connect.Win.Web/VpnHood.App.Connect.Win.Web.csproj index 89f80badf..b4c69c5f6 100644 --- a/Src/Apps/Connect.Win.Web/VpnHood.App.Connect.Win.Web.csproj +++ b/Src/Apps/Connect.Win.Web/VpnHood.App.Connect.Win.Web.csproj @@ -28,7 +28,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.622 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Client.Device.Android/AndroidDevice.cs b/Src/Core/VpnHood.Core.Client.Device.Android/AndroidDevice.cs index 4959b2763..e686f1f48 100644 --- a/Src/Core/VpnHood.Core.Client.Device.Android/AndroidDevice.cs +++ b/Src/Core/VpnHood.Core.Client.Device.Android/AndroidDevice.cs @@ -133,7 +133,7 @@ await Task.WhenAny(_grantPermissionTaskSource.Task, Task.Delay(TimeSpan.FromMinu if (!_grantPermissionTaskSource.Task.IsCompletedSuccessfully) throw new Exception("Could not grant VPN permission in the given time."); - if (!_grantPermissionTaskSource.Task.Result) + if (!await _grantPermissionTaskSource.Task) throw new Exception("VPN permission has been rejected."); } finally { diff --git a/Src/Core/VpnHood.Core.Client.Device.Android/VpnHood.Core.Client.Device.Android.csproj b/Src/Core/VpnHood.Core.Client.Device.Android/VpnHood.Core.Client.Device.Android.csproj index f86c62557..1d332bc6f 100644 --- a/Src/Core/VpnHood.Core.Client.Device.Android/VpnHood.Core.Client.Device.Android.csproj +++ b/Src/Core/VpnHood.Core.Client.Device.Android/VpnHood.Core.Client.Device.Android.csproj @@ -21,7 +21,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Client.Device.WinDivert/VpnHood.Core.Client.Device.WinDivert.csproj b/Src/Core/VpnHood.Core.Client.Device.WinDivert/VpnHood.Core.Client.Device.WinDivert.csproj index bedc6c1f1..215504f0b 100644 --- a/Src/Core/VpnHood.Core.Client.Device.WinDivert/VpnHood.Core.Client.Device.WinDivert.csproj +++ b/Src/Core/VpnHood.Core.Client.Device.WinDivert/VpnHood.Core.Client.Device.WinDivert.csproj @@ -19,7 +19,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Client.Device/VpnHood.Core.Client.Device.csproj b/Src/Core/VpnHood.Core.Client.Device/VpnHood.Core.Client.Device.csproj index 8e0cb1543..ec12b5e4e 100644 --- a/Src/Core/VpnHood.Core.Client.Device/VpnHood.Core.Client.Device.csproj +++ b/Src/Core/VpnHood.Core.Client.Device/VpnHood.Core.Client.Device.csproj @@ -19,7 +19,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Client/Diagnosing/DiagnoseUtil.cs b/Src/Core/VpnHood.Core.Client/Diagnosing/DiagnoseUtil.cs index 4adcd864d..92b1f2168 100644 --- a/Src/Core/VpnHood.Core.Client/Diagnosing/DiagnoseUtil.cs +++ b/Src/Core/VpnHood.Core.Client/Diagnosing/DiagnoseUtil.cs @@ -33,8 +33,9 @@ public class DiagnoseUtil while (tasks.Length > 0) { var task = await Task.WhenAny(tasks).VhConfigureAwait(); exception = task.Result; - if (task.Result == null) + if (exception == null) return null; //at least one task is success + tasks = tasks.Where(x => x != task).ToArray(); } diff --git a/Src/Core/VpnHood.Core.Client/Diagnosing/DnsResolver.cs b/Src/Core/VpnHood.Core.Client/Diagnosing/DnsResolver.cs index 7838eb7fa..a87f4aa09 100644 --- a/Src/Core/VpnHood.Core.Client/Diagnosing/DnsResolver.cs +++ b/Src/Core/VpnHood.Core.Client/Diagnosing/DnsResolver.cs @@ -34,14 +34,16 @@ public static async Task GetHostEntry(string host, IPEndPoint dnsEn // Send the DNS query await udpClient .SendAsync(query, query.Length) - .VhWait(timeout, cancellationToken); + .VhWait(timeout, cancellationToken) + .VhConfigureAwait(); // Wait for response with a timeout - var task = udpClient + var task = await udpClient .ReceiveAsync() - .VhWait(timeout, cancellationToken); + .VhWait(timeout, cancellationToken) + .VhConfigureAwait(); - var response = task.Result.Buffer; + var response = task.Buffer; // Parse the DNS response var hostEntry = ParseDnsResponse(response, queryId); diff --git a/Src/Core/VpnHood.Core.Client/VpnHood.Core.Client.csproj b/Src/Core/VpnHood.Core.Client/VpnHood.Core.Client.csproj index 8cb0a654c..94f726357 100644 --- a/Src/Core/VpnHood.Core.Client/VpnHood.Core.Client.csproj +++ b/Src/Core/VpnHood.Core.Client/VpnHood.Core.Client.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Common/Utils/VhTaskExtensions.cs b/Src/Core/VpnHood.Core.Common/Utils/VhTaskExtensions.cs index 1fee081f0..223bba0bb 100644 --- a/Src/Core/VpnHood.Core.Common/Utils/VhTaskExtensions.cs +++ b/Src/Core/VpnHood.Core.Common/Utils/VhTaskExtensions.cs @@ -37,7 +37,7 @@ public static async Task VhWait(this Task task, int timeout, Cancellati public static async Task VhWait(this Task task, TimeSpan timeout, CancellationToken cancellationToken) { var timeoutTask = Task.Delay(timeout, cancellationToken); - await Task.WhenAny(task, timeoutTask); + await Task.WhenAny(task, timeoutTask).VhConfigureAwait(); // check if the task is canceled cancellationToken.ThrowIfCancellationRequested(); diff --git a/Src/Core/VpnHood.Core.Common/VpnHood.Core.Common.csproj b/Src/Core/VpnHood.Core.Common/VpnHood.Core.Common.csproj index 88df3929d..9da3036a8 100644 --- a/Src/Core/VpnHood.Core.Common/VpnHood.Core.Common.csproj +++ b/Src/Core/VpnHood.Core.Common/VpnHood.Core.Common.csproj @@ -19,7 +19,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Server.Access.FileAccessManager/VpnHood.Core.Server.Access.FileAccessManager.csproj b/Src/Core/VpnHood.Core.Server.Access.FileAccessManager/VpnHood.Core.Server.Access.FileAccessManager.csproj index e897fb073..fe70c5f62 100644 --- a/Src/Core/VpnHood.Core.Server.Access.FileAccessManager/VpnHood.Core.Server.Access.FileAccessManager.csproj +++ b/Src/Core/VpnHood.Core.Server.Access.FileAccessManager/VpnHood.Core.Server.Access.FileAccessManager.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Server.Access/VpnHood.Core.Server.Access.csproj b/Src/Core/VpnHood.Core.Server.Access/VpnHood.Core.Server.Access.csproj index 74d993aa7..4217ca7b7 100644 --- a/Src/Core/VpnHood.Core.Server.Access/VpnHood.Core.Server.Access.csproj +++ b/Src/Core/VpnHood.Core.Server.Access/VpnHood.Core.Server.Access.csproj @@ -20,7 +20,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Server/VpnHood.Core.Server.csproj b/Src/Core/VpnHood.Core.Server/VpnHood.Core.Server.csproj index a189b6884..6da918a55 100644 --- a/Src/Core/VpnHood.Core.Server/VpnHood.Core.Server.csproj +++ b/Src/Core/VpnHood.Core.Server/VpnHood.Core.Server.csproj @@ -19,7 +19,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Src/Core/VpnHood.Core.Tunneling/VpnHood.Core.Tunneling.csproj b/Src/Core/VpnHood.Core.Tunneling/VpnHood.Core.Tunneling.csproj index c6d0c2eba..368685eea 100644 --- a/Src/Core/VpnHood.Core.Tunneling/VpnHood.Core.Tunneling.csproj +++ b/Src/Core/VpnHood.Core.Tunneling/VpnHood.Core.Tunneling.csproj @@ -19,7 +19,7 @@ VpnHood.png https://github.com/vpnhood/vpnhood https://github.com/vpnhood/vpnhood - 5.0.621 + 5.0.629 $([System.DateTime]::Now.ToString("yyyy.M.d.HHmm")) diff --git a/Tests/VpnHood.NetTester/Testers/QuicTesters/QuicTesterClient.cs b/Tests/VpnHood.NetTester/Testers/QuicTesters/QuicTesterClient.cs index df6967b40..6235fd547 100644 --- a/Tests/VpnHood.NetTester/Testers/QuicTesters/QuicTesterClient.cs +++ b/Tests/VpnHood.NetTester/Testers/QuicTesters/QuicTesterClient.cs @@ -42,8 +42,11 @@ public async Task Start(long upSize, long downSize, int connectionCount, } // dispose streams - foreach (var uploadTask in uploadTasks.Where(x => x.IsCompletedSuccessfully)) - uploadTask.Result?.DisposeAsync(); + foreach (var uploadTask in uploadTasks.Where(x => x.IsCompletedSuccessfully)) { + var connectionStream = await uploadTask; + if (connectionStream != null) + await connectionStream.DisposeAsync(); + } } private async Task StartUpload(long upSize, long downSize, diff --git a/Tests/VpnHood.NetTester/Testers/TcpTesters/TcpTesterClient.cs b/Tests/VpnHood.NetTester/Testers/TcpTesters/TcpTesterClient.cs index 05e324fe6..4a7fa209a 100644 --- a/Tests/VpnHood.NetTester/Testers/TcpTesters/TcpTesterClient.cs +++ b/Tests/VpnHood.NetTester/Testers/TcpTesters/TcpTesterClient.cs @@ -30,15 +30,16 @@ public async Task Start(long upSize, long downSize, int connectionCount, Cancell using (var speedometer = new Speedometer("Down")) { var downloadTasks = new Task[connectionCount]; for (var i = 0; i < connectionCount; i++) - if (uploadTasks[i].Result.Connected) - downloadTasks[i] = StartDownload(uploadTasks[i].Result.GetStream(), downSize / connectionCount, speedometer, + if ((await uploadTasks[i]).Connected) + downloadTasks[i] = StartDownload((await uploadTasks[i]).GetStream(), downSize / connectionCount, speedometer, cancellationToken); await Task.WhenAll(downloadTasks); } // dispose streams - foreach (var uploadTask in uploadTasks.Where(x => x.IsCompletedSuccessfully)) uploadTask.Result.Dispose(); + foreach (var uploadTask in uploadTasks.Where(x => x.IsCompletedSuccessfully)) + (await uploadTask).Dispose(); } private static async Task StartUpload(IPEndPoint serverEp, long upSize, long downSize, diff --git a/Tests/VpnHood.Test/Tests/FileAccessServerTest.cs b/Tests/VpnHood.Test/Tests/FileAccessServerTest.cs index f605c7da2..e5b196b08 100644 --- a/Tests/VpnHood.Test/Tests/FileAccessServerTest.cs +++ b/Tests/VpnHood.Test/Tests/FileAccessServerTest.cs @@ -72,7 +72,7 @@ public async Task Crud() Assert.IsTrue(accessTokenDatas.Any(x => x.AccessToken.TokenId == token2.TokenId)); Assert.IsTrue(accessTokenDatas.Any(x => x.AccessToken.TokenId == token3.TokenId)); Assert.AreEqual(2, accessTokenDatas.Length); - Assert.AreEqual(accessManager1.Session_Create(sessionRequestEx1).Result.ErrorCode, + Assert.AreEqual((await accessManager1.Session_Create(sessionRequestEx1)).ErrorCode, SessionErrorCode.AccessError); // ************ @@ -86,7 +86,7 @@ public async Task Crud() // ************ // *** TEST ***: token must be retrieved with TokenId - Assert.AreEqual(SessionErrorCode.Ok, accessManager2.Session_Create(sessionRequestEx2).Result.ErrorCode, + Assert.AreEqual(SessionErrorCode.Ok, (await accessManager2.Session_Create(sessionRequestEx2)).ErrorCode, "Access has not been retrieved"); // ************ @@ -95,7 +95,7 @@ public async Task Crud() var accessManager3 = new FileAccessManager(storagePath, fileAccessManagerOptions); accessTokenDatas = await accessManager3.AccessTokenService.List(); Assert.AreEqual(3, accessTokenDatas.Length); - Assert.AreEqual(SessionErrorCode.Ok, accessManager3.Session_Create(sessionRequestEx2).Result.ErrorCode, + Assert.AreEqual(SessionErrorCode.Ok, (await accessManager3.Session_Create(sessionRequestEx2)).ErrorCode, "access has not been retrieved"); }