Changeset 6453


Ignore:
Timestamp:
Aug 8, 2008, 10:44:32 PM (13 years ago)
Author:
charles
Message:

back out the changes from r6415.

Location:
trunk/libtransmission
Files:
3 edited

Legend:

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

    r6425 r6453  
    6969
    7070    tr_crypto           * crypto;
    71 
    72     uint64_t              fromPeer;
    7371};
    7472
     
    540538    {
    541539        case PEER_ENCRYPTION_NONE:
    542             io->fromPeer += evbuffer_remove( inbuf, bytes, byteCount );
     540            evbuffer_remove( inbuf, bytes, byteCount );
    543541            break;
    544542
    545543        case PEER_ENCRYPTION_RC4:
    546             io->fromPeer += evbuffer_remove( inbuf, bytes, byteCount );
     544            evbuffer_remove( inbuf, bytes, byteCount );
    547545            tr_cryptoDecrypt( io->crypto, byteCount, bytes, bytes );
    548546            break;
     
    596594    return time( NULL ) - io->timeCreated;
    597595}
    598 
    599 int64_t
    600 tr_peerIoCountBytesFromPeer( const tr_peerIo * io )
    601 {
    602     return io->fromPeer;
    603 }
    604 
  • trunk/libtransmission/peer-io.h

    r6415 r6453  
    179179                            size_t             byteCount );
    180180
    181 int64_t tr_peerIoCountBytesFromPeer( const tr_peerIo * io );
    182181
    183182#endif
  • trunk/libtransmission/peer-mgr.c

    r6450 r6453  
    4545
    4646    /* minimum interval for refilling peers' request lists */
    47     REFILL_PERIOD_MSEC = 500,
     47    REFILL_PERIOD_MSEC = 333,
    4848
    4949    /* when many peers are available, keep idle ones this long */
     
    966966            struct peer_atom * atom = getExistingAtom( t, addr );
    967967            if( atom )
    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             }
     968                ++atom->numFails;
    980969        }
    981970
     
    10911080    const uint8_t * walk = compact;
    10921081    tr_pex * pex = tr_new0( tr_pex, n );
     1082if( added_f && strlen(added_f)!=n )
     1083{
     1084    int i;
     1085    const int len = strlen( added_f );
     1086    fprintf( stderr, "compactLen is %d, n is %d, and strlen(added_f) is %d!!!\n", (int)compactLen, (int)n, len );
     1087    for( i=0; i<len; ++i )
     1088        fprintf( stderr, "added.f[%d] is %d\n", i, (int)added_f[i] );
     1089}
    10931090    for( i=0; i<n; ++i ) {
    10941091        memcpy( &pex[i].in_addr, walk, 4 ); walk += 4;
     
    18161813            if( wait > maxWait ) wait = maxWait;
    18171814            if( ( now - atom->time ) < wait ) {
    1818                 /*tordbg( t, "RECONNECT peer %d (%s) is in its grace period of %d seconds..",
    1819                           i, tr_peerIoAddrStr(&atom->addr,atom->port), wait );*/
     1815                tordbg( t, "RECONNECT peer %d (%s) is in its grace period of %d seconds..",
     1816                        i, tr_peerIoAddrStr(&atom->addr,atom->port), wait );
    18201817                continue;
    18211818            }
     
    18971894            if( io == NULL )
    18981895            {
    1899                 /* we've temporarily exceeded our max connection limit... */
     1896                atom->myflags |= MYFLAG_UNREACHABLE;
    19001897            }
    19011898            else
Note: See TracChangeset for help on using the changeset viewer.