From b2250d8ecf56f71ea4c2c7271ac138d1f0196136 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 11 Sep 2017 17:26:04 -0700 Subject: [PATCH] Fix bug 57918: Async Socket reads that need to perform multiple underlying read operations fail to return a correct total # of bytes read --- mcs/class/System/System.Net.Sockets/Socket.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index d19756b6c300..3821602fbbda 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -1902,7 +1902,7 @@ static void BeginSendCallback (SocketAsyncResult sockares, int sent_so_far) sockares.Size -= total; if (sockares.socket.CleanedUp) { - sockares.Complete (total); + sockares.Complete (sent_so_far); return; } @@ -1914,7 +1914,7 @@ static void BeginSendCallback (SocketAsyncResult sockares, int sent_so_far) sockares.Total = sent_so_far; } - sockares.Complete (total); + sockares.Complete (sent_so_far); } [CLSCompliant (false)]