Fix bug 57918:
authorKatelyn Gadd <kg@luminance.org>
Tue, 12 Sep 2017 00:26:04 +0000 (17:26 -0700)
committerKatelyn Gadd <kg@luminance.org>
Tue, 12 Sep 2017 17:37:39 +0000 (10:37 -0700)
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

index 4a889e4dd2709692107c9acee71d19ca0b670551..fe7099144ec561bf5eec1cbabbbfe6c29a1a5490 100644 (file)
@@ -1930,7 +1930,7 @@ namespace System.Net.Sockets
                                sockares.Size -= total;
 
                                if (sockares.socket.CleanedUp) {
-                                       sockares.Complete (total);
+                                       sockares.Complete (sent_so_far);
                                        return;
                                }
 
@@ -1942,7 +1942,7 @@ namespace System.Net.Sockets
                                sockares.Total = sent_so_far;
                        }
 
-                       sockares.Complete (total);
+                       sockares.Complete (sent_so_far);
                }
 
                [CLSCompliant (false)]