ws2_32: Don't post completion packet if sending fails with error immediately.

This commit is contained in:
Ričardas Barkauskas 2011-12-28 01:25:20 +02:00 committed by Alexandre Julliard
parent fa4a90e6d2
commit 1bbe92e79b
2 changed files with 4 additions and 6 deletions

View File

@ -3885,9 +3885,7 @@ static int WS2_sendto( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
}
if (n == -1 && errno != EAGAIN)
{
int loc_errno = errno;
err = wsaErrno();
if (cvalue) WS_AddCompletion( s, cvalue, sock_get_ntstatus(loc_errno), 0 );
goto error;
}

View File

@ -5321,10 +5321,10 @@ static void test_completion_port(void)
bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 );
ok(bret == FALSE, "GetQueuedCompletionStatus returned %u\n", bret );
todo_wine ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError());
todo_wine ok(key == 0xdeadbeef, "Key is %lu\n", key);
todo_wine ok(num_bytes == 0xdeadbeef, "Number of bytes transfered is %u\n", num_bytes);
todo_wine ok(!olp, "Overlaped structure is at %p\n", olp);
ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError());
ok(key == 0xdeadbeef, "Key is %lu\n", key);
ok(num_bytes == 0xdeadbeef, "Number of bytes transfered is %u\n", num_bytes);
ok(!olp, "Overlaped structure is at %p\n", olp);
if (dest != INVALID_SOCKET)
closesocket(dest);