mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
Fix empty latency tests and Linux startup errors (#10335)
* Fix overflow when speed tests have no eligible profiles * Preserve core executable permissions in Debian packages * Avoid requesting an icon refresh before view initialization
This commit is contained in:
@@ -1441,7 +1441,11 @@ public class Utils
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
var currentMode = File.GetUnixFileMode(fileName);
|
||||
File.SetUnixFileMode(fileName, currentMode | UnixFileMode.UserExecute | UnixFileMode.GroupExecute | UnixFileMode.OtherExecute);
|
||||
var executableMode = currentMode | UnixFileMode.UserExecute | UnixFileMode.GroupExecute | UnixFileMode.OtherExecute;
|
||||
if (currentMode != executableMode)
|
||||
{
|
||||
File.SetUnixFileMode(fileName, executableMode);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,6 +587,12 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
|
||||
private List<List<ServerTestItem>> GetTestBatchItem(List<ServerTestItem> lstSelected, int pageSize)
|
||||
{
|
||||
List<List<ServerTestItem>> lstTest = [];
|
||||
if (lstSelected.Count == 0)
|
||||
{
|
||||
return lstTest;
|
||||
}
|
||||
|
||||
pageSize = Math.Max(pageSize, 1);
|
||||
var lst1 = lstSelected.Where(t => t.CoreType == ECoreType.Xray).ToList();
|
||||
var lst2 = lstSelected.Where(t => t.CoreType == ECoreType.sing_box).ToList();
|
||||
|
||||
|
||||
@@ -219,7 +219,8 @@ public partial class StatusBarViewModel : MyReactiveObject
|
||||
await ConfigHandler.InitBuiltinRouting(_config);
|
||||
await RefreshRoutingsMenu();
|
||||
await InboundDisplayStatus();
|
||||
await ChangeSystemProxyAsync(_config.SystemProxyItem.SysProxyType, true);
|
||||
// The view refreshes its icon on initialization; interaction handlers are not registered yet.
|
||||
await ChangeSystemProxyAsync(_config.SystemProxyItem.SysProxyType, false);
|
||||
|
||||
BlRouting = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user