mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libT) fix the new-code errors reported by ZogG and Rolcol and Spaham
This commit is contained in:
@@ -191,13 +191,14 @@ event_read_cb( int fd, short event UNUSED, void * vio )
|
||||
size_t howmuch;
|
||||
const tr_direction dir = TR_DOWN;
|
||||
const size_t max = 256 * 1024;
|
||||
const size_t curlen = EVBUFFER_LENGTH( io->inbuf );
|
||||
|
||||
howmuch = curlen >= max ? 0 : max - curlen;
|
||||
howmuch = tr_bandwidthClamp( &io->bandwidth, TR_DOWN, howmuch );
|
||||
size_t curlen;
|
||||
|
||||
assert( tr_isPeerIo( io ) );
|
||||
|
||||
curlen = EVBUFFER_LENGTH( io->inbuf );
|
||||
howmuch = curlen >= max ? 0 : max - curlen;
|
||||
howmuch = tr_bandwidthClamp( &io->bandwidth, TR_DOWN, howmuch );
|
||||
|
||||
dbgmsg( io, "libevent says this peer is ready to read" );
|
||||
|
||||
/* if we don't have any bandwidth left, stop reading */
|
||||
@@ -496,6 +497,14 @@ tr_peerIoSetIOFuncs( tr_peerIo * io,
|
||||
io->userData = userData;
|
||||
}
|
||||
|
||||
void
|
||||
tr_peerIoClear( tr_peerIo * io )
|
||||
{
|
||||
tr_peerIoSetIOFuncs( io, NULL, NULL, NULL, NULL );
|
||||
tr_peerIoSetEnabled( io, TR_UP, FALSE );
|
||||
tr_peerIoSetEnabled( io, TR_DOWN, FALSE );
|
||||
}
|
||||
|
||||
int
|
||||
tr_peerIoReconnect( tr_peerIo * io )
|
||||
{
|
||||
|
||||
@@ -210,6 +210,8 @@ void tr_peerIoSetIOFuncs ( tr_peerIo * io,
|
||||
tr_net_error_cb errcb,
|
||||
void * user_data );
|
||||
|
||||
void tr_peerIoClear ( tr_peerIo * io );
|
||||
|
||||
/**
|
||||
***
|
||||
**/
|
||||
|
||||
@@ -355,7 +355,7 @@ peerDestructor( tr_peer * peer )
|
||||
tr_peerMsgsFree( peer->msgs );
|
||||
}
|
||||
|
||||
tr_peerIoSetIOFuncs( peer->io, NULL, NULL, NULL, NULL );
|
||||
tr_peerIoClear( peer->io );
|
||||
tr_peerIoUnref( peer->io ); /* balanced by the ref in handshakeDoneCB() */
|
||||
|
||||
tr_bitfieldFree( peer->have );
|
||||
|
||||
@@ -106,7 +106,7 @@ reqListRemoveFromSorted( struct request_list * list, const struct peer_request *
|
||||
static void
|
||||
reqListRemoveNthFromFifo( struct request_list * list, int n )
|
||||
{
|
||||
memmove( &list->fifo[n], &list->fifo[n+1], (list->len-1)*sizeof(struct peer_request));
|
||||
memmove( &list->fifo[n], &list->fifo[n+1], (list->len-n-1)*sizeof(struct peer_request));
|
||||
}
|
||||
|
||||
tr_bool
|
||||
|
||||
Reference in New Issue
Block a user