t->pieceSortState = PIECES_UNSORTED;
}
-const tr_torrent * weightTorrent;
+static const tr_torrent * weightTorrent;
-const uint16_t * weightReplication;
+static const uint16_t * weightReplication;
static void
setComparePieceByWeightTorrent( Torrent * t )
tr_free( blocks );
}
+static void tr_peerMgrSetBlame( tr_torrent *, tr_piece_index_t, int );
+
static void
peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt )
{
***
**/
-void
+static void
tr_peerMgrSetBlame( tr_torrent * tor,
tr_piece_index_t pieceIndex,
int success )
};
static int
-compareChoke( const void * va,
- const void * vb )
+compareChoke( const void * va, const void * vb )
{
const struct ChokeData * a = va;
const struct ChokeData * b = vb;
**/
static void
-pokeBatchPeriod( tr_peermsgs * msgs,
- int interval )
+pokeBatchPeriod( tr_peermsgs * msgs, int interval )
{
if( msgs->outMessagesBatchPeriod > interval )
{
}
static void
-fireClientGotData( tr_peermsgs * msgs,
- uint32_t length,
- int wasPieceData )
+fireClientGotData( tr_peermsgs * msgs, uint32_t length, int wasPieceData )
{
tr_peer_event e = TR_PEER_EVENT_INIT;
}
static void
-firePeerGotData( tr_peermsgs * msgs,
- uint32_t length,
- int wasPieceData )
+firePeerGotData( tr_peermsgs * msgs, uint32_t length, tr_bool wasPieceData )
{
tr_peer_event e = TR_PEER_EVENT_INIT;
*** For explanation, see http://www.bittorrent.org/beps/bep_0006.html
**/
+#if 0
size_t
tr_generateAllowedSet( tr_piece_index_t * setmePieces,
size_t desiredSetSize,
static void
updateFastSet( tr_peermsgs * msgs UNUSED )
{
-#if 0
const tr_bool fext = tr_peerIoSupportsFEXT( msgs->peer->io );
const int peerIsNeedy = msgs->peer->progress < 0.10;
for( i=0; i<msgs->fastsetSize; ++i )
protocolSendAllowedFast( msgs, msgs->fastset[i] );
}
-#endif
}
+#endif
/**
*** INTEREST
}
void
-tr_peerMsgsSetChoke( tr_peermsgs * msgs,
- int choke )
+tr_peerMsgsSetChoke( tr_peermsgs * msgs, int choke )
{
const time_t now = tr_time( );
const time_t fibrillationTime = now - MIN_CHOKE_PERIOD_SEC;
**/
void
-tr_peerMsgsHave( tr_peermsgs * msgs,
- uint32_t index )
+tr_peerMsgsHave( tr_peermsgs * msgs, uint32_t index )
{
protocolSendHave( msgs, index );
}
static void
-parseLtepHandshake( tr_peermsgs * msgs,
- int len,
- struct evbuffer * inbuf )
+parseLtepHandshake( tr_peermsgs * msgs, int len, struct evbuffer * inbuf )
{
int64_t i;
tr_benc val, * sub;
}
static int
-readBtLength( tr_peermsgs * msgs,
- struct evbuffer * inbuf,
- size_t inlen )
+readBtLength( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
{
uint32_t len;
return READ_NOW;
}
-static int readBtMessage( tr_peermsgs * msgs,
- struct evbuffer * inbuf,
- size_t inlen );
+static int readBtMessage( tr_peermsgs *, struct evbuffer *, size_t );
static int
-readBtId( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
+readBtId( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
{
uint8_t id;
{
tr_peerUpdateProgress( msgs->torrent, msgs->peer );
- updateFastSet( msgs );
+ /*updateFastSet( msgs );*/
updateInterest( msgs );
}
}
static void
-peerMadeRequest( tr_peermsgs * msgs,
- const struct peer_request * req )
+peerMadeRequest( tr_peermsgs * msgs, const struct peer_request * req )
{
const tr_bool fext = tr_peerIoSupportsFEXT( msgs->peer->io );
const int reqIsValid = requestIsValid( msgs, req );
/* returns 0 on success, or an errno on failure */
static int
-clientGotBlock( tr_peermsgs * msgs,
- struct evbuffer * data,
- const struct peer_request * req )
+clientGotBlock( tr_peermsgs * msgs,
+ struct evbuffer * data,
+ const struct peer_request * req )
{
int err;
tr_torrent * tor = msgs->torrent;
}
static void
-gotError( tr_peerIo * io UNUSED,
- short what,
- void * vmsgs )
+gotError( tr_peerIo * io UNUSED, short what, void * vmsgs )
{
if( what & BEV_EVENT_TIMEOUT )
dbgmsg( vmsgs, "libevent got a timeout, what=%hd", what );
PexDiffs;
static void
-pexAddedCb( void * vpex,
- void * userData )
+pexAddedCb( void * vpex, void * userData )
{
PexDiffs * diffs = userData;
tr_pex * pex = vpex;
}
static inline void
-pexDroppedCb( void * vpex,
- void * userData )
+pexDroppedCb( void * vpex, void * userData )
{
PexDiffs * diffs = userData;
tr_pex * pex = vpex;
}
static inline void
-pexElementCb( void * vpex,
- void * userData )
+pexElementCb( void * vpex, void * userData )
{
PexDiffs * diffs = userData;
tr_pex * pex = vpex;