From f4fc7ba30de3e1a41de17de274ab2770f0dc9f31 Mon Sep 17 00:00:00 2001 From: Mark Junker Date: Fri, 16 Aug 2019 16:13:30 +0200 Subject: [PATCH] Handle connection closed by client --- .../Commands/DefaultFtpCommandDispatcher.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FubarDev.FtpServer.Abstractions/Commands/DefaultFtpCommandDispatcher.cs b/src/FubarDev.FtpServer.Abstractions/Commands/DefaultFtpCommandDispatcher.cs index 52bb1efe..c1d38763 100644 --- a/src/FubarDev.FtpServer.Abstractions/Commands/DefaultFtpCommandDispatcher.cs +++ b/src/FubarDev.FtpServer.Abstractions/Commands/DefaultFtpCommandDispatcher.cs @@ -7,6 +7,7 @@ using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Linq; +using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; @@ -190,6 +191,9 @@ private async Task ExecuteCommandAsync( _logger?.LogWarning(validationException.Message); break; +#if !NETSTANDARD1_3 + case SocketException se when se.ErrorCode == (int)SocketError.ConnectionAborted: +#endif case OperationCanceledException _: response = new FtpResponse(426, localizationFeature.Catalog.GetString("Connection closed; transfer aborted.")); Debug.WriteLine($"Command {command} cancelled with response {response}");