Ignore:
Timestamp:
Jul 29, 2008, 12:52:02 AM (13 years ago)
Author:
charles
Message:

#1123: unreachable peers need to be handled better

File:
1 edited

Legend:

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

    r6406 r6415  
    4545
    4646    /* minimum interval for refilling peers' request lists */
    47     REFILL_PERIOD_MSEC = 333,
     47    REFILL_PERIOD_MSEC = 500,
    4848
    4949    /* when many peers are available, keep idle ones this long */
     
    966966            struct peer_atom * atom = getExistingAtom( t, addr );
    967967            if( atom )
    968                 ++atom->numFails;
     968            {
     969                /* if we talked but the connection failed, mark a failure
     970                 * in the peer's permanent record.  if they didn't send
     971                 * us anything at all, mark the peer as unreachable. */
     972                if( tr_peerIoCountBytesFromPeer( io ) ) {
     973                    ++atom->numFails;
     974                    tordbg( t, "handshake failed; incremented fail count to %d", (int)atom->numFails );
     975                } else {
     976                    tordbg( t, "no data received at all during handshake; marking as unreachable" );
     977                    atom->myflags |= MYFLAG_UNREACHABLE;
     978                }
     979            }
    969980        }
    970981
     
    18151826            if( wait > maxWait ) wait = maxWait;
    18161827            if( ( now - atom->time ) < wait ) {
    1817                 tordbg( t, "RECONNECT peer %d (%s) is in its grace period of %d seconds..",
    1818                         i, tr_peerIoAddrStr(&atom->addr,atom->port), wait );
     1828                /*tordbg( t, "RECONNECT peer %d (%s) is in its grace period of %d seconds..",
     1829                          i, tr_peerIoAddrStr(&atom->addr,atom->port), wait );*/
    18191830                continue;
    18201831            }
     
    18961907            if( io == NULL )
    18971908            {
    1898                 atom->myflags |= MYFLAG_UNREACHABLE;
     1909                /* we've temporarily exceeded our max connection limit... */
    18991910            }
    19001911            else
Note: See TracChangeset for help on using the changeset viewer.