Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This introduces a test failure, reflecting a failure to trigger FD_OOB after two separate bytes of OOB data are sent. Since two bytes are not actually received, and since the first is never consumed anyway, I am again inclined to argue that this makes the test results more accurate rather than less.
dlls/ws2_32/tests/sock.c | 22 +++++++++++----------- server/sock.c | 9 ++++++--- 2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 596e1ec1a21..266ddc14451 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4391,35 +4391,35 @@ static void test_oob_events(struct event_test_ctx *ctx) ret = send(client, "a", 1, MSG_OOB); ok(ret == 1, "got %d\n", ret);
- check_events_todo_msg(ctx, FD_OOB, 0, 200); - check_events_todo(ctx, 0, 0, 0); + check_events(ctx, FD_OOB, 0, 200); + check_events(ctx, 0, 0, 0); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); if (ctx->is_message) - check_events_todo_msg(ctx, FD_OOB, 0, 200); - check_events_todo(ctx, 0, 0, 0); + check_events(ctx, FD_OOB, 0, 200); + check_events(ctx, 0, 0, 0); select_events(ctx, server, 0); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); if (ctx->is_message) - check_events_todo_msg(ctx, FD_OOB, 0, 200); - check_events_todo(ctx, 0, 0, 0); + check_events(ctx, FD_OOB, 0, 200); + check_events(ctx, 0, 0, 0);
ret = send(client, "b", 1, MSG_OOB); ok(ret == 1, "got %d\n", ret);
if (!ctx->is_message) - check_events(ctx, FD_OOB, 0, 200); - check_events_todo(ctx, 0, 0, 0); + check_events_todo_event(ctx, FD_OOB, 0, 200); + check_events(ctx, 0, 0, 0);
ret = recv(server, buffer, 1, MSG_OOB); ok(ret == 1, "got %d\n", ret);
check_events_todo(ctx, FD_OOB, 0, 200); - check_events_todo_msg(ctx, 0, 0, 0); + check_events(ctx, 0, 0, 0);
ret = recv(server, buffer, 1, MSG_OOB); todo_wine ok(ret == 1, "got %d\n", ret);
- check_events_todo_msg(ctx, 0, 0, 0); + check_events(ctx, 0, 0, 0);
/* Send data while we're not selecting. */
@@ -4428,7 +4428,7 @@ static void test_oob_events(struct event_test_ctx *ctx) ok(ret == 1, "got %d\n", ret); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ);
- check_events_todo_msg(ctx, FD_OOB, 0, 200); + check_events(ctx, FD_OOB, 0, 200);
ret = recv(server, buffer, 1, MSG_OOB); ok(ret == 1, "got %d\n", ret); diff --git a/server/sock.c b/server/sock.c index f74c9396f26..c8cd603149b 100644 --- a/server/sock.c +++ b/server/sock.c @@ -627,9 +627,12 @@ static void post_socket_event( struct sock *sock, unsigned int event_bit, unsign { unsigned int event = (1 << event_bit);
- sock->pending_events |= event; - sock->reported_events |= event; - sock->errors[event_bit] = error; + if (!(sock->reported_events & event)) + { + sock->pending_events |= event; + sock->reported_events |= event; + sock->errors[event_bit] = error; + } }
static void sock_dispatch_events( struct sock *sock, int prevstate, int event, int error )