Changeset 6550


Ignore:
Timestamp:
Aug 16, 2008, 6:07:11 AM (13 years ago)
Author:
charles
Message:

(libT) some more peer connection management: (1) reset `numFails' to zero after a successful connect (2) tweak the reconnect intervals a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r6549 r6550  
    10101010                peer->msgs = tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
    10111011                atom->time = time( NULL );
     1012                atom->numFails = 0;
    10121013            }
    10131014        }
     
    17591760getReconnectIntervalSecs( const struct peer_atom * atom )
    17601761{
    1761     int min;
     1762    int sec;
    17621763
    17631764    switch( atom->numFails )
    17641765    {
    1765         case 0:
    1766         case 1: min = 7; break;
    1767         case 2: min = 15; break;
    1768         case 3: min = 30; break;
    1769         case 4: min = 60; break;
    1770         default: min = 120; break;
    1771     }
    1772 
    1773     return min * 60;
     1766        case 0: sec = 0; break;
     1767        case 1: sec = 30; break;
     1768        case 2: sec = 15*60; break;
     1769        case 3: sec = 30*60; break;
     1770        case 4: sec = 60*60; break;
     1771        default: sec = 120*60; break;
     1772    }
     1773
     1774    return sec;
    17741775}
    17751776
     
    18811882            else
    18821883                ++atom->numFails;
     1884            tordbg( t, "removing bad peer %s", tr_peerIoGetAddrStr( peer->io ) );
    18831885            removePeer( t, peer );
    18841886        }
Note: See TracChangeset for help on using the changeset viewer.