&& ( io->magicNumber == MAGIC_NUMBER )
&& ( io->refCount > 0 )
&& ( tr_isBandwidth( &io->bandwidth ) )
- && ( tr_isAddress( &io->addr ) )
- && ( tr_isBool( io->isEncrypted ) )
- && ( tr_isBool( io->isIncoming ) )
- && ( tr_isBool( io->peerIdIsSet ) )
- && ( tr_isBool( io->extendedProtocolSupported ) )
- && ( tr_isBool( io->fastExtensionSupported ) );
+ && ( tr_isAddress( &io->addr ) );
}
static void
static void
event_enable( tr_peerIo * io, short event )
{
- assert( tr_isPeerIo( io ) );
-
if( event & EV_READ )
event_add( &io->event_read, NULL );
static void
event_disable( struct tr_peerIo * io, short event )
{
- assert( tr_isPeerIo( io ) );
-
if( event & EV_READ )
event_del( &io->event_read );
tr_direction dir,
tr_bool isEnabled )
{
- short event;
+ const short event = dir == TR_UP ? EV_WRITE : EV_READ;
assert( tr_isPeerIo( io ) );
assert( tr_isDirection( dir ) );
- event = dir == TR_UP ? EV_WRITE : EV_READ;
-
if( isEnabled )
event_enable( io, event );
else
static inline char* tr_strdup( const void * in )
{
- return tr_strndup( in, in ? strlen( (const char*)in ) : 0 );
+ return tr_strndup( in, in ? strlen( in ) : 0 );
}
/* @brief same argument list as bsearch() */