diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c index aaa6fa6a2..4768cbf1e 100644 --- a/libtransmission/handshake.c +++ b/libtransmission/handshake.c @@ -968,7 +968,7 @@ void tr_handshakeDone( tr_handshake * handshake, int isOK ) { dbgmsg( handshake, "handshakeDone: %s", isOK ? "connected" : "aborting" ); - tr_peerIoSetIOFuncs( handshake->io, NULL, NULL, NULL, NULL ); + tr_peerIoSetIOFuncs( handshake->io, NULL, NULL, NULL ); fireDoneFunc( handshake, isOK ); @@ -1030,7 +1030,7 @@ tr_handshakeNew( tr_peerIo * io, handshake->doneUserData = doneUserData; handshake->handle = tr_peerIoGetHandle( io ); - tr_peerIoSetIOFuncs( handshake->io, canRead, NULL, gotError, handshake ); + tr_peerIoSetIOFuncs( handshake->io, canRead, gotError, handshake ); if( tr_peerIoIsIncoming( handshake->io ) ) setReadState( handshake, AWAITING_HANDSHAKE ); diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index fbaff2ee1..35db80c32 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -60,7 +60,6 @@ struct tr_peerIo unsigned int peerIdIsSet : 1; tr_can_read_cb canRead; - tr_did_write_cb didWrite; tr_net_error_cb gotError; void * userData; @@ -71,14 +70,6 @@ struct tr_peerIo *** **/ -static void -didWriteWrapper( struct bufferevent * e, void * userData ) -{ - tr_peerIo * c = userData; - if( c->didWrite != NULL ) - (*c->didWrite)( e, c->userData ); -} - static void canReadWrapper( struct bufferevent * e, void * userData ) { @@ -141,7 +132,7 @@ tr_peerIoNew( struct tr_handle * handle, c->isIncoming = isIncoming ? 1 : 0; c->bufev = bufferevent_new( c->socket, canReadWrapper, - didWriteWrapper, + NULL, gotErrorWrapper, c ); bufferevent_settimeout( c->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS ); @@ -199,7 +190,6 @@ tr_peerIoFree( tr_peerIo * io ) if( io != NULL ) { io->canRead = NULL; - io->didWrite = NULL; io->gotError = NULL; tr_runInEventThread( io->handle, io_dtor, io ); } @@ -249,12 +239,10 @@ tr_peerIoTryRead( tr_peerIo * io ) void tr_peerIoSetIOFuncs( tr_peerIo * io, tr_can_read_cb readcb, - tr_did_write_cb writecb, tr_net_error_cb errcb, void * userData ) { io->canRead = readcb; - io->didWrite = writecb; io->gotError = errcb; io->userData = userData; @@ -282,9 +270,7 @@ tr_peerIoReconnect( tr_peerIo * io ) bufferevent_free( io->bufev ); io->bufev = bufferevent_new( io->socket, - canReadWrapper, - didWriteWrapper, - gotErrorWrapper, + canReadWrapper, NULL, gotErrorWrapper, io ); bufferevent_settimeout( io->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS ); bufferevent_enable( io->bufev, EV_READ|EV_WRITE ); diff --git a/libtransmission/peer-io.h b/libtransmission/peer-io.h index 78403ad25..cfa8e49df 100644 --- a/libtransmission/peer-io.h +++ b/libtransmission/peer-io.h @@ -99,12 +99,10 @@ const uint8_t* typedef enum { READ_MORE, READ_AGAIN, READ_DONE } ReadState; typedef ReadState (*tr_can_read_cb)(struct bufferevent*, void* user_data); -typedef void (*tr_did_write_cb)(struct bufferevent *, void *); typedef void (*tr_net_error_cb)(struct bufferevent *, short what, void *); void tr_peerIoSetIOFuncs( tr_peerIo * io, tr_can_read_cb readcb, - tr_did_write_cb writecb, tr_net_error_cb errcb, void * user_data ); diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index c10ece528..b5bd69613 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -1777,7 +1777,7 @@ tr_peerMsgsNew( struct tr_torrent * torrent, } tr_peerIoSetTimeoutSecs( m->io, 150 ); /* timeout after N seconds of inactivity */ - tr_peerIoSetIOFuncs( m->io, canRead, NULL, gotError, m ); + tr_peerIoSetIOFuncs( m->io, canRead, gotError, m ); ratePulse( m ); if ( tr_peerIoSupportsLTEP( m->io ) )