From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ws2_32/tests/sock.c | 20 ++++++++++---------- server/sock.c | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 4247a54d157..e37887fadc8 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -9850,9 +9850,9 @@ static void test_completion_port(void)
/* Somehow a hard shutdown doesn't work on my Linux box. It seems SO_LINGER is ignored. */ iret = WSARecv(dest, &bufs, 1, &num_bytes, &flags, &ov, NULL); - todo_wine ok(iret == SOCKET_ERROR, "WSARecv failed - %d\n", iret); - todo_wine ok(GetLastError() == WSAECONNRESET, "Last error was %ld\n", GetLastError()); - todo_wine ok(num_bytes == 0xdeadbeef, "Managed to read %ld\n", num_bytes); + ok(iret == SOCKET_ERROR, "WSARecv failed - %d\n", iret); + ok(GetLastError() == WSAECONNRESET, "Last error was %ld\n", GetLastError()); + ok(num_bytes == 0xdeadbeef, "Managed to read %ld\n", num_bytes);
SetLastError(0xdeadbeef); key = 0xdeadbeef; @@ -9860,11 +9860,11 @@ static void test_completion_port(void) olp = (WSAOVERLAPPED *)0xdeadbeef;
bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); - todo_wine ok(bret == FALSE, "GetQueuedCompletionStatus returned %u\n", bret ); - todo_wine ok(GetLastError() == WAIT_TIMEOUT, "Last error was %ld\n", GetLastError()); - todo_wine ok(key == 0xdeadbeef, "Key is %Iu\n", key); - todo_wine ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %lu\n", num_bytes); - todo_wine ok(!olp, "Overlapped structure is at %p\n", olp); + ok(bret == FALSE, "GetQueuedCompletionStatus returned %u\n", bret ); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %ld\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %Iu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %lu\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp);
closesocket(dest);
@@ -12894,8 +12894,8 @@ static void test_tcp_reset(void) WSASetLastError(0xdeadbeef); size = 0xdeadbeef; ret = WSARecv(client, &wsabuf, 1, &size, &flags, &overlapped, NULL); - todo_wine ok(ret == -1, "got %d\n", ret); - todo_wine ok(WSAGetLastError() == WSAECONNRESET, "got error %u\n", WSAGetLastError()); + ok(ret == -1, "got %d\n", ret); + ok(WSAGetLastError() == WSAECONNRESET, "got error %u\n", WSAGetLastError());
WSASetLastError(0xdeadbeef); ret = send(client, "data", 5, 0); diff --git a/server/sock.c b/server/sock.c index 7d7e470be28..49ce4d254f6 100644 --- a/server/sock.c +++ b/server/sock.c @@ -3461,7 +3461,10 @@ DECL_HANDLER(recv_socket) if (!req->force_async && !sock->nonblocking && is_fd_overlapped( fd )) timeout = (timeout_t)sock->rcvtimeo * -10000;
- if (sock->rd_shutdown) status = STATUS_PIPE_DISCONNECTED; + if (sock->rd_shutdown) + status = STATUS_PIPE_DISCONNECTED; + else if (sock->reset) + status = STATUS_CONNECTION_RESET; else if (!async_queued( &sock->read_q )) { /* If read_q is not empty, we cannot really tell if the already queued