mirror of https://github.com/2dust/v2rayN
				
				
				
			AI-optimized code
							parent
							
								
									d4a8787356
								
							
						
					
					
						commit
						c3439c5abe
					
				| 
						 | 
				
			
			@ -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 New Issue