From c8ae834f508cfe46a1e7a04ff1d731e35ab8b878 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 27 Apr 2023 14:17:27 +0800 Subject: [PATCH] bug fixes --- v2rayN/v2rayN/Base/DownloaderHelper.cs | 3 ++- v2rayN/v2rayN/Handler/ConfigHandler.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/Base/DownloaderHelper.cs b/v2rayN/v2rayN/Base/DownloaderHelper.cs index 851ba8a8..51a7840b 100644 --- a/v2rayN/v2rayN/Base/DownloaderHelper.cs +++ b/v2rayN/v2rayN/Base/DownloaderHelper.cs @@ -112,7 +112,8 @@ namespace v2rayN.Base }; //progress.Report("......"); using var cts = new CancellationTokenSource(); - using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token).WaitAsync(TimeSpan.FromSeconds(timeout), cts.Token); + cts.CancelAfter(timeout * 1000); + using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token); downloadOpt = null; } diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index f9a23a89..1f7e6598 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -1281,7 +1281,7 @@ namespace v2rayN.Handler { return -1; } - var customProfile = SqliteHelper.Instance.Table().Where(t => t.subid == subid && t.isSub == isSub && t.configType == EConfigType.Custom).ToList(); + var customProfile = SqliteHelper.Instance.Table().Where(t => t.subid == subid && t.configType == EConfigType.Custom).ToList(); if (isSub) { SqliteHelper.Instance.Execute($"delete from ProfileItem where isSub = 1 and subid = '{subid}'");