1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 14:10:34 +00:00

(libT) misc cleanup

This commit is contained in:
Charles Kerr 2008-12-02 18:24:26 +00:00
parent f927ea5d63
commit 9d39ed2540
4 changed files with 33 additions and 37 deletions

View file

@ -444,6 +444,7 @@ protocolSendHave( tr_peermsgs * msgs,
pokeBatchPeriod( msgs, LOW_PRIORITY_INTERVAL_SECS );
}
#if 0
static void
protocolSendAllowedFast( tr_peermsgs * msgs, uint32_t pieceIndex )
{
@ -459,6 +460,7 @@ protocolSendAllowedFast( tr_peermsgs * msgs, uint32_t pieceIndex )
dbgmsg( msgs, "sending Allowed Fast %u...", pieceIndex );
dbgOutMessageLen( msgs );
}
#endif
static void
protocolSendChoke( tr_peermsgs * msgs,

View file

@ -1101,7 +1101,7 @@ checkAndStartImpl( void * vtor )
tr_globalLock( tor->session );
tor->isRunning = 1;
tor->isRunning = 1;
*tor->errorString = '\0';
tr_torrentResetTransferStats( tor );
tor->completeness = tr_cpGetStatus( tor->completion );
@ -1340,7 +1340,7 @@ tr_torrentRecheckCompleteness( tr_torrent * tor )
int
tr_torrentIsSeed( const tr_torrent * tor )
{
return tor->completeness == TR_SEED || tor->completeness == TR_PARTIAL_SEED;
return tor->completeness != TR_LEECH;
}
/**

View file

@ -686,30 +686,29 @@ buildTrackerRequestURI( tr_tracker * t,
"&peer_id=%s"
"&port=%d"
"&uploaded=%" PRIu64
"&downloaded=%" PRIu64
"&corrupt=%" PRIu64
"&left=%" PRIu64
"&compact=1"
"&numwant=%d"
"&key=%s"
"%s%s"
"%s%s",
strchr( ann, '?' ) ? '&' : '?',
t->escaped,
t->peer_id,
tr_sessionGetPeerPort( t->session ),
torrent->uploadedCur,
torrent->downloadedCur,
torrent->corruptCur,
tr_cpLeftUntilComplete( torrent->completion ),
numwant,
t->key_param,
( ( eventName && *eventName ) ? "&event=" : "" ),
( ( eventName && *eventName ) ? eventName : "" ),
( ( t->trackerID
&& *t->trackerID ) ? "&trackerid=" : "" ),
( ( t->trackerID
&& *t->trackerID ) ? t->trackerID : "" ) );
"&downloaded=%" PRIu64
"&corrupt=%" PRIu64
"&left=%" PRIu64
"&compact=1"
"&numwant=%d"
"&key=%s",
strchr( ann, '?' ) ? '&' : '?',
t->escaped,
t->peer_id,
tr_sessionGetPeerPort( t->session ),
torrent->uploadedCur,
torrent->downloadedCur,
torrent->corruptCur,
tr_cpLeftUntilComplete( torrent->completion ),
numwant,
t->key_param );
if( eventName && *eventName )
evbuffer_add_printf( buf, "&event=%s", eventName );
if( t->trackerID && *t->trackerID )
evbuffer_add_printf( buf, "&trackerid=%s", t->trackerID );
}
static struct tr_tracker_request*

View file

@ -90,18 +90,13 @@ void tr_trackerChangeMyPort( struct tr_tracker * );
const tr_tracker_info * tr_trackerGetAddress( struct tr_tracker * );
int tr_trackerCanManualAnnounce(
const struct tr_tracker * );
int tr_trackerCanManualAnnounce( const struct tr_tracker * );
time_t tr_trackerGetManualAnnounceTime(
const struct tr_tracker * );
time_t tr_trackerGetManualAnnounceTime( const struct tr_tracker * );
void tr_trackerGetCounts(
const struct tr_tracker *,
int *
setme_completedCount,
int *
setme_leecherCount,
int * setme_seederCount );
void tr_trackerGetCounts( const struct tr_tracker *,
int * setme_completedCount,
int * setme_leecherCount,
int * setme_seederCount );
#endif