server: Reselect the socket returned from accept_socket().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52024
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-12-29 17:15:33 -06:00 committed by Alexandre Julliard
parent 4c617058a2
commit b1a2238a10
2 changed files with 4 additions and 2 deletions

View File

@ -5166,8 +5166,8 @@ static void test_accept_events(struct event_test_ctx *ctx)
server = accept(listener, NULL, NULL);
ok(server != -1, "failed to accept, error %u\n", WSAGetLastError());
ctx->socket = server;
check_events_todo(ctx, FD_WRITE, 0, 200);
check_events_todo_event(ctx, 0, 0, 0);
check_events(ctx, FD_WRITE, 0, 200);
check_events(ctx, 0, 0, 0);
closesocket(server);
closesocket(client);

View File

@ -722,6 +722,7 @@ static void complete_async_accept( struct sock *sock, struct accept_req *req )
handle = alloc_handle_no_access_check( async_get_thread( async )->process, &acceptsock->obj,
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, OBJ_INHERIT );
acceptsock->wparam = handle;
sock_reselect( acceptsock );
release_object( acceptsock );
if (!handle)
{
@ -2174,6 +2175,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
handle = alloc_handle( current->process, &acceptsock->obj,
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, OBJ_INHERIT );
acceptsock->wparam = handle;
sock_reselect( acceptsock );
release_object( acceptsock );
set_reply_data( &handle, sizeof(handle) );
return;