Changeset 3861 for trunk/libtransmission/peer-mgr.c
- Timestamp:
- Nov 17, 2007, 11:43:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r3825 r3861 36 36 #include "ratecontrol.h" 37 37 #include "shared.h" 38 #include "trcompat.h" /* strlcpy */ 38 39 #include "trevent.h" 39 40 #include "utils.h" … … 1414 1415 1415 1416 tr_netNtop( &peer->in_addr, stat->addr, sizeof(stat->addr) ); 1417 strlcpy( stat->client, (peer->client ? peer->client : ""), sizeof(stat->client) ); 1416 1418 stat->port = peer->port; 1417 1419 stat->from = atom->from; 1418 stat->client = tr_strdup( peer->client ? peer->client : "" );1419 1420 stat->progress = peer->progress; 1420 1421 stat->isEncrypted = tr_peerIoIsEncrypted( peer->io ) ? 1 : 0; … … 1423 1424 stat->isDownloading = stat->uploadToRate > 0.01; 1424 1425 stat->isUploading = stat->downloadFromRate > 0.01; 1426 stat->status = peer->status; 1425 1427 } 1426 1428 … … 1483 1485 rechoke( Torrent * t ) 1484 1486 { 1485 int i, peerCount, size=0 , unchoked=0;1487 int i, peerCount, size=0; 1486 1488 const time_t fibrillationTime = time(NULL) - MIN_CHOKE_PERIOD_SEC; 1487 1489 tr_peer ** peers = getConnectedPeers( t, &peerCount ); … … 1506 1508 qsort( choke, size, sizeof(struct ChokeData), compareChoke ); 1507 1509 1508 for( i=0; i<size && i<NUM_UNCHOKED_PEERS_PER_TORRENT; ++i ) {1510 for( i=0; i<size && i<NUM_UNCHOKED_PEERS_PER_TORRENT; ++i ) 1509 1511 choke[i].doUnchoke = 1; 1510 ++unchoked;1511 }1512 1512 1513 1513 for( ; i<size; ++i ) { 1514 1514 choke[i].doUnchoke = 1; 1515 ++unchoked;1516 1515 if( choke[i].peer->peerIsInterested ) 1517 1516 break;
Note: See TracChangeset
for help on using the changeset viewer.