Ignore:
Timestamp:
Jan 11, 2008, 2:09:20 AM (14 years ago)
Author:
charles
Message:

follow the spec's suggestion that new connections be 3x as likely for optimistic unchoke

File:
1 edited

Legend:

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

    r4600 r4608  
    5959    struct bufferevent * bufev;
    6060    uint8_t peerId[20];
     61    time_t timeCreated;
    6162
    6263    tr_extensions extensions;
     
    147148    c->isIncoming = isIncoming ? 1 : 0;
    148149    c->timeout = IO_TIMEOUT_SECS;
     150    c->timeCreated = time( NULL );
    149151    c->bufev = bufferevent_new( c->socket,
    150152                                canReadWrapper,
     
    583585    tr_free( tmp );
    584586}
     587
     588int
     589tr_peerGetAge( const tr_peerIo * io )
     590{
     591    return time( NULL ) - io->timeCreated;
     592}
Note: See TracChangeset for help on using the changeset viewer.