mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 13:42:24 +00:00
AI-optimized code
This commit is contained in:
parent
d4a8787356
commit
c3439c5abe
2 changed files with 7 additions and 3 deletions
|
@ -15,7 +15,7 @@ namespace ServiceLib.Handler
|
|||
|
||||
public static async Task Start(string configPath, int httpPort, int pacPort)
|
||||
{
|
||||
_needRestart = (configPath != _configPath || httpPort != _httpPort || pacPort != _pacPort || !_isRunning);
|
||||
_needRestart = configPath != _configPath || httpPort != _httpPort || pacPort != _pacPort || !_isRunning;
|
||||
|
||||
_configPath = configPath;
|
||||
_httpPort = httpPort;
|
||||
|
@ -70,7 +70,7 @@ namespace ServiceLib.Handler
|
|||
}
|
||||
|
||||
var client = await _tcpListener.AcceptTcpClientAsync();
|
||||
await Task.Run(() => { WriteContent(client); });
|
||||
await Task.Run(() => WriteContent(client));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -90,7 +90,9 @@ namespace ServiceLib.Handler
|
|||
public static void Stop()
|
||||
{
|
||||
if (_tcpListener == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_isRunning = false;
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace ServiceLib.Handler
|
|||
private static readonly Lazy<WebDavHandler> _instance = new(() => new());
|
||||
public static WebDavHandler Instance => _instance.Value;
|
||||
|
||||
private Config? _config;
|
||||
private readonly Config? _config;
|
||||
private WebDavClient? _client;
|
||||
private string? _lastDescription;
|
||||
private string _webDir = Global.AppName + "_backup";
|
||||
|
@ -62,7 +62,9 @@ namespace ServiceLib.Handler
|
|||
private async Task<bool> TryCreateDir()
|
||||
{
|
||||
if (_client is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
var result2 = await _client.Mkcol(_webDir);
|
||||
|
|
Loading…
Reference in a new issue