When splitting the send request into multiple buffers, we must

succeed after we have successfully sent the first buffer, even if not a
single byte of some following buffer could be sent. We should probably
even succeed whatever the error code -- not sure what is the reason
for only doing that for B_WOULD_BLOCK and B_INTERRUPTED.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25121 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-04-24 02:20:00 +00:00
parent ccf92546c4
commit 5843f17cb8

View File

@ -1154,7 +1154,7 @@ socket_send(net_socket *socket, msghdr *header, const void *data, size_t length,
size_t sizeAfterSend = buffer->size;
gNetBufferModule.free(buffer);
if (sizeAfterSend != bufferSize
if ((sizeAfterSend != bufferSize || bytesSent > 0)
&& (status == B_INTERRUPTED || status == B_WOULD_BLOCK)) {
// this appears to be a partial write
return bytesSent + (bufferSize - sizeAfterSend);