Ignore:
Timestamp:
Dec 20, 2008, 10:19:34 PM (12 years ago)
Author:
charles
Message:

try to rework the bandwidth code yet again s.t. it satisfies all three: (1) fairly distributes bandwidth across all peers, (2) scales well in high-bandwidth situations, (3) is good at hitting and staying at bandwidth limits/goals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r7419 r7441  
    10911091}
    10921092
     1093void
     1094tr_handshakeFree( tr_handshake * handshake )
     1095{
     1096    if( handshake->io )
     1097        tr_peerIoFree( handshake->io );
     1098
     1099    tr_free( handshake );
     1100}
     1101
    10931102static int
    10941103tr_handshakeDone( tr_handshake * handshake,
    10951104                  int            isOK )
    10961105{
    1097     int success;
     1106    tr_bool success;
    10981107
    10991108    dbgmsg( handshake, "handshakeDone: %s", isOK ? "connected" : "aborting" );
     
    11011110
    11021111    success = fireDoneFunc( handshake, isOK );
    1103 
    1104     tr_free( handshake );
    11051112
    11061113    return success ? READ_LATER : READ_ERR;
     
    11931200}
    11941201
     1202struct tr_peerIo*
     1203tr_handshakeStealIO( tr_handshake * handshake )
     1204{
     1205    struct tr_peerIo * io;
     1206
     1207    assert( handshake );
     1208    assert( handshake->io );
     1209
     1210    io = handshake->io;
     1211    handshake->io = NULL;
     1212    return io;
     1213}
     1214
    11951215const tr_address *
    11961216tr_handshakeGetAddr( const struct tr_handshake * handshake,
Note: See TracChangeset for help on using the changeset viewer.