1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

(trunk libT) remove unnecessary code

This commit is contained in:
Charles Kerr 2009-11-28 16:25:05 +00:00
parent d1f9b8ddee
commit de0d6af06b
2 changed files with 0 additions and 42 deletions

View file

@ -338,7 +338,6 @@ peerConstructor( struct peer_atom * atom )
tr_bitsetConstructor( &peer->have, 0 ); tr_bitsetConstructor( &peer->have, 0 );
peer->atom = atom; peer->atom = atom;
atom->peer = peer; atom->peer = peer;
peer->atom = atom;
return peer; return peer;
} }

View file

@ -496,45 +496,6 @@ tr_torrentPromoteTracker( tr_torrent * tor,
return i; return i;
} }
struct RandomTracker
{
tr_tracker_info tracker;
int random_value;
};
/* the tiers will be sorted from lowest to highest,
* and trackers are randomized within the tiers */
static TR_INLINE int
compareRandomTracker( const void * va,
const void * vb )
{
const struct RandomTracker * a = va;
const struct RandomTracker * b = vb;
if( a->tracker.tier != b->tracker.tier )
return a->tracker.tier - b->tracker.tier;
return a->random_value - b->random_value;
}
static void
randomizeTiers( tr_info * info )
{
int i;
const int n = info->trackerCount;
struct RandomTracker * r = tr_new0( struct RandomTracker, n );
for( i = 0; i < n; ++i )
{
r[i].tracker = info->trackers[i];
r[i].random_value = tr_cryptoRandInt( INT_MAX );
}
qsort( r, n, sizeof( struct RandomTracker ), compareRandomTracker );
for( i = 0; i < n; ++i )
info->trackers[i] = r[i].tracker;
tr_free( r );
}
static void torrentStart( tr_torrent * tor ); static void torrentStart( tr_torrent * tor );
/** /**
@ -641,8 +602,6 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
tor->uniqueId = nextUniqueId++; tor->uniqueId = nextUniqueId++;
tor->magicNumber = TORRENT_MAGIC_NUMBER; tor->magicNumber = TORRENT_MAGIC_NUMBER;
randomizeTiers( &tor->info );
tr_sha1( tor->obfuscatedHash, "req2", 4, tr_sha1( tor->obfuscatedHash, "req2", 4,
tor->info.hash, SHA_DIGEST_LENGTH, tor->info.hash, SHA_DIGEST_LENGTH,
NULL ); NULL );