Commit fae0b6fa authored by Mike Kaplinskiy's avatar Mike Kaplinskiy Committed by Alexandre Julliard

ws2_32: Don't set FD_READ/FD_WRITE before the connection is complete.

parent 5288a225
......@@ -1844,7 +1844,7 @@ int WINAPI WS_connect(SOCKET s, const struct WS_sockaddr* name, int namelen)
{
/* tell wineserver that a connection is in progress */
_enable_event(SOCKET2HANDLE(s), FD_CONNECT|FD_READ|FD_WRITE,
FD_CONNECT|FD_READ|FD_WRITE,
FD_CONNECT,
FD_WINE_CONNECTED|FD_WINE_LISTENING);
if (_is_blocking(s))
{
......
......@@ -524,6 +524,7 @@ static enum server_fd_type sock_get_fd_type( struct fd *fd )
static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count )
{
struct sock *sock = get_fd_user( fd );
struct async *async;
struct async_queue *queue;
assert( sock->obj.ops == &sock_ops );
......@@ -543,20 +544,19 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type,
return;
}
if ( ( !( sock->state & FD_READ ) && type == ASYNC_TYPE_READ ) ||
( !( sock->state & FD_WRITE ) && type == ASYNC_TYPE_WRITE ) )
if ( ( !( sock->state & (FD_READ|FD_CONNECT) ) && type == ASYNC_TYPE_READ ) ||
( !( sock->state & (FD_WRITE|FD_CONNECT) ) && type == ASYNC_TYPE_WRITE ) )
{
set_error( STATUS_PIPE_DISCONNECTED );
return;
}
else
{
struct async *async;
if (!(async = create_async( current, queue, data ))) return;
release_object( async );
set_error( STATUS_PENDING );
}
if (!(async = create_async( current, queue, data ))) return;
release_object( async );
sock_reselect( sock );
set_error( STATUS_PENDING );
}
static void sock_reselect_async( struct fd *fd, struct async_queue *queue )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment