This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit a6882f9
committed
Fix SendAsync on Unix with multiple buffers
In the implementation of Send{To}Async for a list of array segments, we try to do the send operation, and if it doesn't send the full amount (e.g. because it does one send that's less than the full amount and then tries to complete it but gets an EAGAIN), we then fall back to creating a SendOperation that stores the data to try again later. But the number of bytes sent wasn't being copied into that SendOperation data structure, so although the data had been sent and although we were correctly updating the pointers to what to send next and when we were done sending, the actual total number of BytesTransferred at the end of the operation would be missing the sum from that initial successful set of synchronous sends prior to the EAGAIN. The fix is simply to store the initial bytesSent into BytesTransferred, as is done for every other send operation on SocketAsyncContext.1 parent 5fa821e commit a6882f9
File tree
1 file changed
+1
-0
lines changed- src/System.Net.Sockets/src/System/Net/Sockets
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1385 | 1385 | | |
1386 | 1386 | | |
1387 | 1387 | | |
| 1388 | + | |
1388 | 1389 | | |
1389 | 1390 | | |
1390 | 1391 | | |
| |||
0 commit comments