Changeset 3197 for trunk/libtransmission/peer-mgr.c
- Timestamp:
- Sep 27, 2007, 3:03:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r3184 r3197 69 69 /* this is arbitrary and, hopefully, temporary until we come up 70 70 * with a better idea for managing the connection limits */ 71 MAX_CONNECTED_PEERS_PER_TORRENT = 60,71 MAX_CONNECTED_PEERS_PER_TORRENT = 100, 72 72 73 73 /* if we hang up on a peer for being worthless, don't try to … … 651 651 652 652 case TR_PEERMSG_PEER_PROGRESS: { /* if we're both seeds, then disconnect. */ 653 #if 0 653 654 const int clientIsSeed = tr_cpGetStatus( t->tor->completion ) != TR_CP_INCOMPLETE; 654 655 const int peerIsSeed = e->progress >= 1.0; 655 656 if( clientIsSeed && peerIsSeed ) 656 657 peer->doPurge = 1; 658 #endif 657 659 break; 658 660 } … … 967 969 } 968 970 971 /* Returns the pieces that we and/or a connected peer has */ 972 tr_bitfield* 973 tr_peerMgrGetAvailable( const tr_peerMgr * manager, 974 const uint8_t * torrentHash ) 975 { 976 int i, size; 977 const Torrent * t; 978 const tr_peer ** peers; 979 tr_bitfield * pieces; 980 981 t = getExistingTorrent( (tr_peerMgr*)manager, torrentHash ); 982 peers = (const tr_peer **) tr_ptrArrayPeek( t->peers, &size ); 983 pieces = tr_bitfieldDup( tr_cpPieceBitfield( t->tor->completion ) ); 984 for( i=0; i<size; ++i ) 985 if( peers[i]->io != NULL ) 986 tr_bitfieldAnd( pieces, peers[i]->have ); 987 988 return pieces; 989 } 969 990 970 991 void
Note: See TracChangeset
for help on using the changeset viewer.