Zebediah Figura : server: Do not signal read bits if there are read asyncs alerted.

Alexandre Julliard julliard at winehq.org
Thu May 5 15:56:01 CDT 2022


Module: wine
Branch: master
Commit: 30a56639fde4daf5e1eb3c3d37541b1bc9f75a6d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=30a56639fde4daf5e1eb3c3d37541b1bc9f75a6d

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu May  5 00:43:27 2022 -0500

server: Do not signal read bits if there are read asyncs alerted.

Asyncs which are alerted but not "waiting" may still consume all data, and we
shouldn't signal AFD_POLL_READ or AFD_POLL_OOB in that case.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/sock.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/server/sock.c b/server/sock.c
index cf25994c383..2bb2963a840 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1001,10 +1001,13 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error )
     if ((event & POLLOUT) && sock->connect_req && sock->connect_req->iosb->status == STATUS_PENDING)
         complete_async_connect( sock );
 
-    if (event & (POLLIN | POLLPRI) && async_waiting( &sock->read_q ))
+    if ((event & (POLLIN | POLLPRI)) && async_queued( &sock->read_q ))
     {
-        if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock );
-        async_wake_up( &sock->read_q, STATUS_ALERTED );
+        if (async_waiting( &sock->read_q ))
+        {
+            if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock );
+            async_wake_up( &sock->read_q, STATUS_ALERTED );
+        }
         event &= ~(POLLIN | POLLPRI);
     }
 




More information about the wine-cvs mailing list