Previously, do_sendmsg iterated through all iovec buffers supplied by the user, regardless of whether the host-level write to the socket (via DkStreamWrite) was able to send the whole buffer or only part of the buffer.
This could lead to data corruptions: Graphene would send only some parts of the buffers (i.e., with gaps) but would report to the user app the total sum of sent bytes (i.e., without gaps).
This PR fixes this by simply bailing out on the first encountered host-level partial write.
Fixes #2664
How to test this PR?
Create a communication channel between client and server and send large size data for example 4194299 bytes multiple times.
Signed-off-by: Jitender Kumar jitender.kumar@intel.com
Description of the changes
Previously,
do_sendmsg
iterated through all iovec buffers supplied by the user, regardless of whether the host-level write to the socket (viaDkStreamWrite
) was able to send the whole buffer or only part of the buffer.This could lead to data corruptions: Graphene would send only some parts of the buffers (i.e., with gaps) but would report to the user app the total sum of sent bytes (i.e., without gaps).
This PR fixes this by simply bailing out on the first encountered host-level partial write.
Fixes #2664
How to test this PR?
Create a communication channel between client and server and send large size data for example 4194299 bytes multiple times.
This change is