From: Zebediah Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53058 --- dlls/ws2_32/tests/sock.c | 12 ++++++------ server/sock.c | 10 +++++++--- 2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index f6feb0fa8b4..6c24202ad3b 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -12867,7 +12867,7 @@ static void test_connect_time(void) ok(!ret, "got %d\n", ret); ok(!GetLastError(), "got error %lu\n", GetLastError()); ok(len == sizeof(time), "got len %d\n", len); - todo_wine ok(time == ~0u, "got time %u\n", time); + ok(time == ~0u, "got time %u\n", time);
len = sizeof(time); SetLastError(0xdeadbeef); @@ -12948,19 +12948,19 @@ static void test_connect_udp(void) todo_wine ok(GetLastError() == WSAENOTCONN, "got error %lu\n", GetLastError());
ret = connect(client, (struct sockaddr *)&addr, sizeof(addr)); - todo_wine ok(!ret, "got error %lu\n", GetLastError()); + ok(!ret, "got error %lu\n", GetLastError()); ++addr.sin_port; ret = connect(client, (struct sockaddr *)&addr, sizeof(addr)); - todo_wine ok(!ret, "got error %lu\n", GetLastError()); + ok(!ret, "got error %lu\n", GetLastError());
memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_UNSPEC; ret = connect(client, (struct sockaddr *)&addr, sizeof(addr)); - todo_wine ok(!ret, "got error %lu\n", GetLastError()); + ok(!ret, "got error %lu\n", GetLastError());
ret = getpeername(client, (struct sockaddr *)&ret_addr, &len); - todo_wine ok(ret == -1, "got %d\n", ret); - todo_wine ok(GetLastError() == WSAENOTCONN, "got error %lu\n", GetLastError()); + ok(ret == -1, "got %d\n", ret); + ok(GetLastError() == WSAENOTCONN, "got error %lu\n", GetLastError());
closesocket(server); closesocket(client); diff --git a/server/sock.c b/server/sock.c index fed8e3b3093..7bb72119dc4 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2358,13 +2358,17 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
if (!ret) { - sock->state = SOCK_CONNECTED; - sock->connect_time = current_time; + if (sock->type != WS_SOCK_DGRAM) + { + sock->state = SOCK_CONNECTED; + sock->connect_time = current_time; + }
if (!send_len) return; }
- sock->state = SOCK_CONNECTING; + if (sock->type != WS_SOCK_DGRAM) + sock->state = SOCK_CONNECTING;
if (params->synchronous && sock->nonblocking) {