aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/events_libevent.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-05-14 11:05:41 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-05-14 11:05:41 +0200
commit5330e3d7fdb323ee4176b36639b59f6f90c22617 (patch)
tree778714a7175e560d986a773b3bf2872139fb9582 /protocols/events_libevent.c
parent919c27cc6f1d7654505ac17e80d1fd7197a233f5 (diff)
Oops, closesocket() didn't handle sockets with both a read- and a
write-handler very well yet.
Diffstat (limited to 'protocols/events_libevent.c')
-rw-r--r--protocols/events_libevent.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/events_libevent.c b/protocols/events_libevent.c
index 429ca821..67f973b9 100644
--- a/protocols/events_libevent.c
+++ b/protocols/events_libevent.c
@@ -228,9 +228,14 @@ void closesocket( int fd )
get a little bit messed up. So this little function will remove the handlers
properly before closing a socket. */
- if( ( b_ev = g_hash_table_lookup( read_hash, &fd ) ) || ( b_ev = g_hash_table_lookup( write_hash, &fd ) ) )
+ if( b_ev = g_hash_table_lookup( read_hash, &fd ) )
{
- event_debug( "Warning: Had to clean up some event handlers before closing fd %d.\n", fd );
+ event_debug( "Warning: fd %d still had a read event handler when shutting down.\n", fd );
+ b_event_remove( b_ev->id );
+ }
+ if( b_ev = g_hash_table_lookup( write_hash, &fd ) )
+ {
+ event_debug( "Warning: fd %d still had a write event handler when shutting down.\n", fd );
b_event_remove( b_ev->id );
}