aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-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 );
}
17' href='#n117'>117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173