From b4c4809c029bf30f55671145c2fe4595a6a1c764 Mon Sep 17 00:00:00 2001 From: Scott Lindeneau Date: Mon, 1 Sep 2008 03:40:59 +0900 Subject: [PATCH] Implements sock_queue_async_l To: wine-patches Implements the function sock_queue_async_l which will queue a locatable async request. Identical functionality as sock_queue_async but calls create_async_l instead of create_async sock_queue_async rewritten to use the sock_queue_async_l function using NULL as the locator. This results in identical behavior. --- include/wine/server_protocol.h | 2 +- server/sock.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e01a193..e4f1378 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4999,6 +4999,6 @@ union generic_reply struct add_fd_completion_reply add_fd_completion_reply; }; -#define SERVER_PROTOCOL_VERSION 343 +#define SERVER_PROTOCOL_VERSION 346 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/sock.c b/server/sock.c index cf822b6..d386db3 100644 --- a/server/sock.c +++ b/server/sock.c @@ -96,6 +96,7 @@ static int sock_get_poll_events( struct fd *fd ); static void sock_poll_event( struct fd *fd, int event ); 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 ); +static void sock_queue_async_l( struct fd *fd, const async_data_t *data, int type, int count, obj_handle_t locator ); static void sock_reselect_async( struct fd *fd, struct async_queue *queue ); static void sock_cancel_async( struct fd *fd ); @@ -490,9 +491,9 @@ static enum server_fd_type sock_get_fd_type( struct fd *fd ) return FD_TYPE_SOCKET; } -static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count ) +static void sock_queue_async_l( struct fd *fd, const async_data_t *data, int type, int count, obj_handle_t locator ) { - struct sock *sock = get_fd_user( fd ); +struct sock *sock = get_fd_user( fd ); struct async_queue *queue; int pollev; @@ -514,7 +515,7 @@ 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 ) || + if ( ( !( sock->state & (FD_READ | FD_WINE_LISTENING) ) && type == ASYNC_TYPE_READ ) || ( !( sock->state & FD_WRITE ) && type == ASYNC_TYPE_WRITE ) ) { set_error( STATUS_PIPE_DISCONNECTED ); @@ -522,13 +523,19 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, else { struct async *async; - if (!(async = create_async( current, queue, data ))) return; + if (!(async = create_async_l( current, queue, data, locator ))) return; release_object( async ); set_error( STATUS_PENDING ); } pollev = sock_reselect( sock ); if ( pollev ) sock_try_event( sock, pollev ); + +} + +static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count ) +{ + sock_queue_async_l(fd,data,type,count,NULL); } static void sock_reselect_async( struct fd *fd, struct async_queue *queue ) @@ -790,6 +797,7 @@ static void sock_set_error(void) set_error( sock_get_error( errno ) ); } + /* create a socket */ DECL_HANDLER(create_socket) { -- 1.5.4.3