Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/FubarDev.FtpServer/Networking/StreamPipeWriterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Buffers;
using System.IO;
using System.IO.Pipelines;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -72,6 +73,11 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken)
await SendDataToStream(readResult.Buffer, CancellationToken.None)
.ConfigureAwait(false);
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.ConnectionReset)
{
Logger?.LogDebug(ex, "Sending data failed. The remote peer closed the connection.");
return;
}
catch (Exception ex)
{
Logger?.LogWarning(ex, "Sending data failed {ErrorMessage}", ex.Message);
Expand Down