mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
Merge c43bc49feb
into e1b1c606e1
This commit is contained in:
commit
1678181bbf
@ -204,6 +204,8 @@ public partial class MainWin : Window
|
||||
{
|
||||
HoldButtonTimer?.Stop();
|
||||
|
||||
NginxConfWatcher_Changed(null!, null!);
|
||||
|
||||
if (!MainPres.IsConginxRunning && !MainPres.IsNginxRunning)
|
||||
{
|
||||
try
|
||||
@ -769,13 +771,9 @@ public partial class MainWin : Window
|
||||
NginxHttpPort = 80;
|
||||
NginxHttpsPort = 443;
|
||||
|
||||
foreach (IPEndPoint activeTcpListener in IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners())
|
||||
if (activeTcpListener.Port == NginxHttpPort)
|
||||
NginxHttpPort++;
|
||||
else if (activeTcpListener.Port == NginxHttpsPort)
|
||||
NginxHttpsPort++;
|
||||
else if (activeTcpListener.Port > NginxHttpsPort)
|
||||
break;
|
||||
HashSet<int> activePorts = new(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners().Select(listener => listener.Port));
|
||||
while (activePorts.Contains(NginxHttpPort)) NginxHttpPort++;
|
||||
while (activePorts.Contains(NginxHttpsPort)) NginxHttpsPort++;
|
||||
|
||||
await using FileStream nginxConfStream = new(MainConst.NginxConfPath, FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
||||
NginxConfig extraNginxConfig = NginxConfig.Load(ExtraNginxConfs = new StreamReader(nginxConfStream).ReadToEnd());
|
||||
|
Loading…
Reference in New Issue
Block a user