Mike Kaplinskiy : server: Allow queuing async reads on listening sockets.

Alexandre Julliard julliard at winehq.org
Tue Aug 31 11:16:03 CDT 2010


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

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Sun Aug 29 18:09:55 2010 -0400

server: Allow queuing async reads on listening sockets.

---

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

diff --git a/server/sock.c b/server/sock.c
index 886872d..4f54c46 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -492,15 +492,12 @@ static int sock_get_poll_events( struct fd *fd )
     if (sock->state & FD_CONNECT)
         /* connecting, wait for writable */
         return POLLOUT;
-    if (sock->state & FD_WINE_LISTENING)
-        /* listening, wait for readable */
-        return (mask & FD_ACCEPT) ? POLLIN : 0;
 
     if ( async_queued( sock->read_q ) )
     {
         if ( async_waiting( sock->read_q ) ) ev |= POLLIN | POLLPRI;
     }
-    else if (smask & FD_READ)
+    else if (smask & FD_READ || (sock->state & FD_WINE_LISTENING && mask & FD_ACCEPT))
         ev |= POLLIN | POLLPRI;
     /* We use POLLIN with 0 bytes recv() as FD_CLOSE indication for stream sockets. */
     else if ( sock->type == SOCK_STREAM && sock->state & FD_READ && mask & FD_CLOSE &&
@@ -545,7 +542,7 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type,
         return;
     }
 
-    if ( ( !( sock->state & (FD_READ|FD_CONNECT) ) && type == ASYNC_TYPE_READ  ) ||
+    if ( ( !( sock->state & (FD_READ|FD_CONNECT|FD_WINE_LISTENING) ) && type == ASYNC_TYPE_READ  ) ||
          ( !( sock->state & (FD_WRITE|FD_CONNECT) ) && type == ASYNC_TYPE_WRITE ) )
     {
         set_error( STATUS_PIPE_DISCONNECTED );




More information about the wine-cvs mailing list