server: Add support for restarting an async I/O when the client side couldn't finish it right away.
diff --git a/server/sock.c b/server/sock.c
index 90103f9..51109c3 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -97,6 +97,7 @@
static void sock_poll_event( struct fd *fd, int event );
static enum server_fd_type sock_get_info( struct fd *fd, int *flags );
static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
+static void sock_reselect_async( struct fd *fd, struct async_queue *queue );
static void sock_cancel_async( struct fd *fd );
static int sock_get_error( int err );
@@ -126,6 +127,7 @@
no_flush, /* flush */
sock_get_info, /* get_file_info */
sock_queue_async, /* queue_async */
+ sock_reselect_async, /* reselect_async */
sock_cancel_async /* cancel_async */
};
@@ -556,6 +558,13 @@
if ( pollev ) sock_try_event( sock, pollev );
}
+static void sock_reselect_async( struct fd *fd, struct async_queue *queue )
+{
+ struct sock *sock = get_fd_user( fd );
+ int events = sock_reselect( sock );
+ if (events) sock_try_event( sock, events );
+}
+
static void sock_cancel_async( struct fd *fd )
{
struct sock *sock = get_fd_user( fd );