Commit 8a4433d6 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Do not set connectionless sockets into the CONNECTING or CONNECTED state.

parent 568a7153
......@@ -13035,7 +13035,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);
......@@ -13116,19 +13116,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);
......
......@@ -2385,13 +2385,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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment