Ignore:
Timestamp:
Sep 6, 2007, 12:33:33 AM (15 years ago)
Author:
charles
Message:

still way too buggy, but I can now seed at full speed using < 2% of the CPU. =)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/peer-io.c

    r2971 r2978  
    226226    assert( !tr_peerIoIsIncoming( io ) );
    227227
     228fprintf( stderr, "tr_peerIoReconnect: io %p\n", io );
     229
    228230    if( io->socket >= 0 )
    229231        tr_netClose( io->socket );
    230232
    231     io->socket = tr_netOpenTCP( &io->in_addr,
    232                                         io->port, 0 );
    233 
    234     return io->socket >= 0 ? 0 : -1;
     233    io->socket = tr_netOpenTCP( &io->in_addr, io->port, 0 );
     234
     235fprintf( stderr, "tr_peerIoReconnect: io->socket is %d\n", io->socket );
     236 
     237    if( io->socket >= 0 )
     238    {
     239        bufferevent_free( io->bufev );
     240
     241        io->bufev = bufferevent_new( io->socket,
     242                                     canReadWrapper,
     243                                     didWriteWrapper,
     244                                     gotErrorWrapper,
     245                                     io );
     246        bufferevent_enable( io->bufev, EV_READ|EV_WRITE );
     247
     248        return 0;
     249    }
     250 
     251    return -1;
    235252}
    236253
Note: See TracChangeset for help on using the changeset viewer.