Mike Kaplinskiy : server: In case of hangup/error, wake up all asyncs that can no longer be completed.

Alexandre Julliard julliard at winehq.org
Tue Jul 20 11:20:32 CDT 2010


Module: wine
Branch: master
Commit: be230adbb7400d84fcc5312a0463eee7480709e9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=be230adbb7400d84fcc5312a0463eee7480709e9

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Sat Jul 17 22:06:55 2010 -0400

server: In case of hangup/error, wake up all asyncs that can no longer be completed.

---

 server/sock.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/server/sock.c b/server/sock.c
index 87628da..568f818 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -299,16 +299,23 @@ static void sock_dispatch_asyncs( struct sock *sock, int event )
 {
     if ( sock->flags & WSA_FLAG_OVERLAPPED )
     {
-        if ( event & (POLLIN|POLLPRI|POLLERR|POLLHUP) && async_waiting( sock->read_q ))
+        if ( event & (POLLIN|POLLPRI) && 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 );
         }
-        if ( event & (POLLOUT|POLLERR|POLLHUP) && async_waiting( sock->write_q ))
+        if ( event & POLLOUT && async_waiting( sock->write_q ) )
         {
             if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock );
             async_wake_up( sock->write_q, STATUS_ALERTED );
         }
+        if ( event & (POLLERR|POLLHUP) )
+        {
+            if ( !(sock->state & FD_READ) )
+                async_wake_up( sock->read_q, STATUS_SUCCESS );
+            if ( !(sock->state & FD_WRITE) )
+                async_wake_up( sock->write_q, STATUS_SUCCESS );
+        }
     }
 }
 




More information about the wine-cvs mailing list