From 8e669d9a61ba4558b5de8d63c83936684c277b2c Mon Sep 17 00:00:00 2001 From: Mike Kaplinskiy Date: Sat, 2 Jan 2010 03:44:32 -0500 Subject: [PATCH] server: Activate pending asyncs on a hangup/error. --- server/sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sock.c b/server/sock.c index 71d8ccb42c8..ed89ca2a5f5 100644 --- a/server/sock.c +++ b/server/sock.c @@ -248,13 +248,13 @@ static void sock_wake_up( struct sock *sock, int pollev ) int i; int async_active = 0; - if ( pollev & (POLLIN|POLLPRI) && async_waiting( sock->read_q )) + if ( pollev & (POLLIN|POLLPRI|POLLERR|POLLHUP) && 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 ); async_active = 1; } - if ( pollev & POLLOUT && async_waiting( sock->write_q )) + if ( pollev & (POLLOUT|POLLERR|POLLHUP) && 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 ); -- 2.11.4.GIT