1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

(trunk libT) remove r8370's testing assertions

This commit is contained in:
Charles Kerr 2009-05-11 16:04:31 +00:00
parent dddb6a121d
commit 76d8410f7e

View file

@ -364,7 +364,6 @@ removePeer( Torrent * t, tr_peer * peer )
{ {
tr_peer * removed; tr_peer * removed;
struct peer_atom * atom = peer->atom; struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
assert( torrentIsLocked( t ) ); assert( torrentIsLocked( t ) );
assert( atom ); assert( atom );
@ -919,7 +918,6 @@ addStrike( Torrent * t, tr_peer * peer )
if( ++peer->strikes >= MAX_BAD_PIECES_PER_PEER ) if( ++peer->strikes >= MAX_BAD_PIECES_PER_PEER )
{ {
struct peer_atom * atom = peer->atom; struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
atom->myflags |= MYFLAG_BANNED; atom->myflags |= MYFLAG_BANNED;
peer->doPurge = 1; peer->doPurge = 1;
tordbg( t, "banning peer %s", tr_peerIoAddrStr( &atom->addr, atom->port ) ); tordbg( t, "banning peer %s", tr_peerIoAddrStr( &atom->addr, atom->port ) );
@ -1007,10 +1005,8 @@ peerCallbackFunc( void * vpeer, void * vevent, void * vt )
{ {
case TR_PEER_UPLOAD_ONLY: case TR_PEER_UPLOAD_ONLY:
/* update our atom */ /* update our atom */
if( peer ) { if( peer )
assert( peer->atom == getExistingAtom( t, &peer->addr ) );
peer->atom->uploadOnly = e->uploadOnly ? UPLOAD_ONLY_YES : UPLOAD_ONLY_NO; peer->atom->uploadOnly = e->uploadOnly ? UPLOAD_ONLY_YES : UPLOAD_ONLY_NO;
}
break; break;
case TR_PEER_NEED_REQ: case TR_PEER_NEED_REQ:
@ -1036,10 +1032,8 @@ assert( peer->atom == getExistingAtom( t, &peer->addr ) );
tr_statsAddUploaded( tor->session, e->length ); tr_statsAddUploaded( tor->session, e->length );
/* update our atom */ /* update our atom */
if( peer && e->wasPieceData ) { if( peer && e->wasPieceData )
assert( peer->atom == getExistingAtom( t, &peer->addr ) );
peer->atom->piece_data_time = now; peer->atom->piece_data_time = now;
}
tor->needsSeedRatioCheck = TRUE; tor->needsSeedRatioCheck = TRUE;
@ -1077,10 +1071,8 @@ assert( peer->atom == getExistingAtom( t, &peer->addr ) );
tr_statsAddDownloaded( tor->session, e->length ); tr_statsAddDownloaded( tor->session, e->length );
/* update our atom */ /* update our atom */
if( peer && e->wasPieceData ) { if( peer && e->wasPieceData )
assert( peer->atom == getExistingAtom( t, &peer->addr ) );
peer->atom->piece_data_time = now; peer->atom->piece_data_time = now;
}
break; break;
} }
@ -1091,7 +1083,6 @@ assert( peer->atom == getExistingAtom( t, &peer->addr ) );
{ {
struct peer_atom * atom = peer->atom; struct peer_atom * atom = peer->atom;
const int peerIsSeed = e->progress >= 1.0; const int peerIsSeed = e->progress >= 1.0;
assert( peer->atom == getExistingAtom( t, &peer->addr ) );
if( peerIsSeed ) { if( peerIsSeed ) {
tordbg( t, "marking peer %s as a seed", tr_peerIoAddrStr( &atom->addr, atom->port ) ); tordbg( t, "marking peer %s as a seed", tr_peerIoAddrStr( &atom->addr, atom->port ) );
atom->flags |= ADDED_F_SEED_FLAG; atom->flags |= ADDED_F_SEED_FLAG;
@ -1554,7 +1545,6 @@ tr_peerMgrGetPeers( tr_torrent * tor,
if( peer->addr.type == af ) if( peer->addr.type == af )
{ {
const struct peer_atom * atom = peer->atom; const struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
assert( tr_isAddress( &peer->addr ) ); assert( tr_isAddress( &peer->addr ) );
walk->addr = peer->addr; walk->addr = peer->addr;
@ -1746,7 +1736,6 @@ tr_peerMgrTorrentStats( tr_torrent * tor,
{ {
const tr_peer * peer = peers[i]; const tr_peer * peer = peers[i];
const struct peer_atom * atom = peer->atom; const struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
if( peer->io == NULL ) /* not connected */ if( peer->io == NULL ) /* not connected */
continue; continue;
@ -1832,7 +1821,6 @@ tr_peerMgrPeerStats( const tr_torrent * tor,
const tr_peer * peer = peers[i]; const tr_peer * peer = peers[i];
const struct peer_atom * atom = peer->atom; const struct peer_atom * atom = peer->atom;
tr_peer_stat * stat = ret + i; tr_peer_stat * stat = ret + i;
assert( atom == getExistingAtom( t, &peer->addr ) );
tr_ntop( &peer->addr, stat->addr, sizeof( stat->addr ) ); tr_ntop( &peer->addr, stat->addr, sizeof( stat->addr ) );
tr_strlcpy( stat->client, ( peer->client ? peer->client : "" ), tr_strlcpy( stat->client, ( peer->client ? peer->client : "" ),
@ -1935,7 +1923,6 @@ rechokeTorrent( Torrent * t )
{ {
tr_peer * peer = peers[i]; tr_peer * peer = peers[i];
struct peer_atom * atom = peer->atom; struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
if( peer->progress >= 1.0 ) /* choke all seeds */ if( peer->progress >= 1.0 ) /* choke all seeds */
{ {
@ -2055,7 +2042,6 @@ shouldPeerBeClosed( const Torrent * t,
const tr_torrent * tor = t->tor; const tr_torrent * tor = t->tor;
const time_t now = time( NULL ); const time_t now = time( NULL );
const struct peer_atom * atom = peer->atom; const struct peer_atom * atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
/* if it's marked for purging, close it */ /* if it's marked for purging, close it */
if( peer->doPurge ) if( peer->doPurge )
@ -2260,7 +2246,6 @@ closePeer( Torrent * t, tr_peer * peer )
assert( peer != NULL ); assert( peer != NULL );
atom = peer->atom; atom = peer->atom;
assert( atom == getExistingAtom( t, &peer->addr ) );
/* if we transferred piece data, then they might be good peers, /* if we transferred piece data, then they might be good peers,
so reset their `numFails' weight to zero. otherwise we connected so reset their `numFails' weight to zero. otherwise we connected