Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Mar 7, 2024
1 parent 315b51e commit 028c9ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Common/Utile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public static string GetPunycode(string url)
try
{
Uri uri = new(url);
if (uri.Host == uri.IdnHost)
if (uri.Host == uri.IdnHost || uri.Host == $"[{uri.IdnHost}]")
{
return url;
}
Expand Down
12 changes: 6 additions & 6 deletions v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ void _updateUI(bool success, string msg)
_noticeHandler?.SendMessage(msg);
if (success)
{
CloseV2ray();
CloseCore();

string fileName = Utile.GetTempPath(Utile.GetDownloadFileName(msg));
string toPath = Utile.GetBinPath("", type.ToString());
Expand Down Expand Up @@ -1495,13 +1495,13 @@ private void CheckUpdateGeo()

#endregion CheckUpdate

#region v2ray job
#region core job

public void Reload()
{
BlReloadEnabled = false;

LoadV2ray().ContinueWith(task =>
LoadCore().ContinueWith(task =>
{
TestServerAvailability();
Expand All @@ -1512,7 +1512,7 @@ public void Reload()
});
}

private async Task LoadV2ray()
private async Task LoadCore()
{
await Task.Run(() =>
{
Expand All @@ -1524,7 +1524,7 @@ await Task.Run(() =>
});
}

private void CloseV2ray()
private void CloseCore()
{
ConfigHandler.SaveConfig(_config, false);

Expand All @@ -1533,7 +1533,7 @@ private void CloseV2ray()
_coreHandler.CoreStop();
}

#endregion v2ray job
#endregion core job

#region System proxy and Routings

Expand Down

0 comments on commit 028c9ea

Please sign in to comment.