remove dead code.
This commit is contained in:
parent
815fb89b91
commit
a048204380
|
@ -403,7 +403,8 @@ tr_peerIoWrite( tr_peerIo * io,
|
|||
const void * writeme,
|
||||
int writeme_len )
|
||||
{
|
||||
tr_bufferevent_write( io->handle, io->bufev, writeme, writeme_len );
|
||||
assert( tr_amInEventThread( io->handle ) );
|
||||
bufferevent_write( io->bufev, (void*)writeme, writeme_len );
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -65,7 +65,6 @@ enum mode
|
|||
{
|
||||
TR_EV_EVHTTP_MAKE_REQUEST,
|
||||
TR_EV_BUFFEREVENT_SET,
|
||||
TR_EV_BUFFEREVENT_WRITE,
|
||||
TR_EV_TIMER_ADD,
|
||||
TR_EV_TIMER_DEL,
|
||||
TR_EV_EXEC
|
||||
|
@ -149,11 +148,6 @@ pumpList( int i UNUSED, short s UNUSED, void * veh )
|
|||
bufferevent_disable( cmd->bufev, cmd->disable );
|
||||
break;
|
||||
|
||||
case TR_EV_BUFFEREVENT_WRITE:
|
||||
bufferevent_write( cmd->bufev, cmd->buf, cmd->buflen );
|
||||
tr_free( cmd->buf );
|
||||
break;
|
||||
|
||||
case TR_EV_EXEC:
|
||||
(cmd->func)( cmd->user_data );
|
||||
break;
|
||||
|
@ -255,6 +249,13 @@ pushList( struct tr_event_handle * eh, struct tr_event_command * command )
|
|||
tr_lockUnlock( eh->lock );
|
||||
}
|
||||
|
||||
int
|
||||
tr_amInEventThread( struct tr_handle * handle )
|
||||
{
|
||||
return tr_amInThread( handle->events->thread );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tr_evhttp_make_request (tr_handle * handle,
|
||||
struct evhttp_connection * evcon,
|
||||
|
@ -276,24 +277,6 @@ tr_evhttp_make_request (tr_handle * handle,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
tr_bufferevent_write( tr_handle * handle,
|
||||
struct bufferevent * bufev,
|
||||
const void * buf,
|
||||
size_t buflen )
|
||||
{
|
||||
if( tr_amInThread( handle->events->thread ) )
|
||||
bufferevent_write( bufev, (void*)buf, buflen );
|
||||
else {
|
||||
struct tr_event_command * cmd = tr_new0( struct tr_event_command, 1 );
|
||||
cmd->mode = TR_EV_BUFFEREVENT_WRITE;
|
||||
cmd->bufev = bufev;
|
||||
cmd->buf = tr_strndup( buf, buflen );
|
||||
cmd->buflen = buflen;
|
||||
pushList( handle->events, cmd );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tr_setBufferEventMode( struct tr_handle * handle,
|
||||
struct bufferevent * bufev,
|
||||
|
|
|
@ -37,17 +37,13 @@ void tr_evhttp_make_request (struct tr_handle * tr_handle,
|
|||
enum evhttp_cmd_type type,
|
||||
char * uri);
|
||||
|
||||
void tr_bufferevent_write( struct tr_handle * tr_handle,
|
||||
struct bufferevent * bufferEvent,
|
||||
const void * buf,
|
||||
size_t buflen );
|
||||
|
||||
|
||||
void tr_setBufferEventMode( struct tr_handle * tr_handle,
|
||||
struct bufferevent * bufferEvent,
|
||||
short mode_enable,
|
||||
short mode_disable );
|
||||
|
||||
int tr_amInEventThread( struct tr_handle * handle );
|
||||
|
||||
/**
|
||||
***
|
||||
**/
|
||||
|
|
Loading…
Reference in New Issue