Changeset 3783
- Timestamp:
- Nov 10, 2007, 3:13:31 PM (15 years ago)
- Location:
- branches/0.9x
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9x/NEWS
r3723 r3783 1 1 NEWS file for Transmission <http://transmission.m0k.org/> 2 3 0.93 (2007/xx/yy) 4 - All Platforms: 5 + Fix "router death" bug that impaired internet use by 6 cycling through too many peer connections too quickly 7 + Fix bug that could cause good peer connections to be lost 8 + Tweak our request queue code to improve download speeds 2 9 3 10 0.92 (2007/11/05) -
branches/0.9x/libtransmission/peer-mgr.c
r3780 r3783 916 916 if( !ok || !t || !t->isRunning ) 917 917 { 918 if( t ) { 919 struct peer_atom * atom = getExistingAtom( t, addr ); 920 if( atom ) 921 ++atom->numFails; 922 } 923 918 924 tr_peerIoFree( io ); 919 925 } … … 1590 1596 1591 1597 static int 1592 compare AtomByTime( const void * va, const void * vb )1598 compareCandidates( const void * va, const void * vb ) 1593 1599 { 1594 1600 const struct peer_atom * a = * (const struct peer_atom**) va; 1595 1601 const struct peer_atom * b = * (const struct peer_atom**) vb; 1596 if( a->time < b->time ) return -1; 1597 if( a->time > b->time ) return 1; 1602 int i; 1603 1604 if(( i = tr_compareUint16( a->numFails, b->numFails ))) 1605 return i; 1606 1607 if( a->time != b->time ) 1608 return a->time < b->time ? -1 : 1; 1609 1598 1610 return 0; 1599 1611 } … … 1639 1651 } 1640 1652 1653 /* we're wasting our time trying to connect to this bozo. */ 1654 if( atom->numFails > 10 ) { 1655 tordbg( t, "RECONNECT peer %d (%s) gives us nothing but failure.", 1656 i, tr_peerIoAddrStr(&atom->addr,atom->port) ); 1657 continue; 1658 } 1659 1641 1660 /* if we used this peer recently, give someone else a turn */ 1642 minWait = 60; /* one minute*/1643 maxWait = (60 * 10); /* tenminutes */1644 wait = atom->numFails * 15; /* add 15 secs to the wait interval for each consecutive failure*/1661 minWait = 10; /* ten seconds */ 1662 maxWait = (60 * 20); /* twenty minutes */ 1663 wait = atom->numFails * 30; /* add 15 secs to the wait interval for each consecutive failure*/ 1645 1664 if( wait < minWait ) wait = minWait; 1646 1665 if( wait > maxWait ) wait = maxWait; … … 1654 1673 } 1655 1674 1656 qsort( ret, retCount, sizeof(struct peer_atom*), compare AtomByTime);1675 qsort( ret, retCount, sizeof(struct peer_atom*), compareCandidates ); 1657 1676 *setmeSize = retCount; 1658 1677 return ret;
Note: See TracChangeset
for help on using the changeset viewer.