Add assertions to libevent callbacks.

They should never be called with a UTP socket.
This commit is contained in:
Juliusz Chroboczek 2011-02-18 00:24:15 +00:00
parent 18f1ddb7aa
commit 5563729d61
1 changed files with 2 additions and 0 deletions

View File

@ -218,6 +218,7 @@ event_read_cb( int fd, short event UNUSED, void * vio )
const unsigned int max = 256 * 1024;
assert( tr_isPeerIo( io ) );
assert( io->socket >= 0 );
io->pendingEvents &= ~EV_READ;
@ -293,6 +294,7 @@ event_write_cb( int fd, short event UNUSED, void * vio )
const tr_direction dir = TR_UP;
assert( tr_isPeerIo( io ) );
assert( io->socket >= 0 );
io->pendingEvents &= ~EV_WRITE;