Changeset 7423
- Timestamp:
- Dec 16, 2008, 11:31:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r7422 r7423 1337 1337 } 1338 1338 1339 static int 1340 tr_isPex( const tr_pex * pex ) 1341 { 1342 return pex && tr_isAddress( &pex->addr ); 1343 } 1344 1339 1345 void 1340 1346 tr_peerMgrAddPex( tr_peerMgr * manager, … … 1344 1350 { 1345 1351 Torrent * t; 1346 1347 1352 managerLock( manager ); 1353 1354 assert( tr_isPex( pex ) ); 1348 1355 1349 1356 t = getExistingTorrent( manager, torrentHash ); … … 1464 1471 const tr_pex * a = va; 1465 1472 const tr_pex * b = vb; 1466 int i = tr_compareAddresses( &a->addr, &b->addr ); 1467 1468 if( i ) return i; 1469 if( a->port < b->port ) return -1; 1470 if( a->port > b->port ) return 1; 1473 int i; 1474 1475 assert( tr_isPex( a ) ); 1476 assert( tr_isPex( b ) ); 1477 1478 if(( i = tr_compareAddresses( &a->addr, &b->addr ))) 1479 return i; 1480 1481 if( a->port != b->port ) 1482 return a->port < b->port ? -1 : 1; 1483 1471 1484 return 0; 1472 1485 } … … 1530 1543 } 1531 1544 1532 #warning this for loop can be removed when we 're sure the bug is fixed1545 #warning this for loop can be removed when we are sure the bug is fixed 1533 1546 for( i=0; i<peersReturning; ++i ) 1534 1547 assert( tr_isAddress( &pex[i].addr ) ); … … 1537 1550 qsort( pex, peersReturning, sizeof( tr_pex ), tr_pexCompare ); 1538 1551 1539 #warning this for loop can be removed when we 're sure the bug is fixed1552 #warning this for loop can be removed when we are sure the bug is fixed 1540 1553 for( i=0; i<peersReturning; ++i ) 1541 1554 assert( tr_isAddress( &pex[i].addr ) );
Note: See TracChangeset
for help on using the changeset viewer.