Add assertions to libevent callbacks.
They should never be called with a UTP socket.
This commit is contained in:
parent
18f1ddb7aa
commit
5563729d61
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue