ws2_32: Update WSASendTo's iovec properly.

This commit is contained in:
Damjan Jovanovic 2007-07-15 13:58:31 +02:00 committed by Alexandre Julliard
parent a2c2b60292
commit 15428534d8

View file

@ -2717,13 +2717,11 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
if (n > 0)
{
*lpNumberOfBytesSent += n;
if (iovec[first_buff].iov_len > n)
iovec[first_buff].iov_len -= n;
else
{
while (n > 0) n -= iovec[first_buff++].iov_len;
if (first_buff >= dwBufferCount) break;
}
while (first_buff < dwBufferCount && iovec[first_buff].iov_len <= n)
n -= iovec[first_buff++].iov_len;
if (first_buff >= dwBufferCount) break;
iovec[first_buff].iov_base = (char*)iovec[first_buff].iov_base + n;
iovec[first_buff].iov_len -= n;
}
if (timeout != -1)