Skip to content

Commit f4fc7ba

Browse files
committed
Handle connection closed by client
1 parent 88dfe8e commit f4fc7ba

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/FubarDev.FtpServer.Abstractions/Commands/DefaultFtpCommandDispatcher.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.ComponentModel.DataAnnotations;
88
using System.Diagnostics;
99
using System.Linq;
10+
using System.Net.Sockets;
1011
using System.Threading;
1112
using System.Threading.Tasks;
1213

@@ -190,6 +191,9 @@ private async Task ExecuteCommandAsync(
190191
_logger?.LogWarning(validationException.Message);
191192
break;
192193

194+
#if !NETSTANDARD1_3
195+
case SocketException se when se.ErrorCode == (int)SocketError.ConnectionAborted:
196+
#endif
193197
case OperationCanceledException _:
194198
response = new FtpResponse(426, localizationFeature.Catalog.GetString("Connection closed; transfer aborted."));
195199
Debug.WriteLine($"Command {command} cancelled with response {response}");

0 commit comments

Comments
 (0)