Ignore:
Timestamp:
Nov 16, 2007, 8:40:03 PM (15 years ago)
Author:
charles
Message:

progress on the "speed limits kill my transfer rate" bug.

File:
1 edited

Legend:

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

    r3830 r3839  
    9999                    continue;
    100100            case READ_MORE:
    101                 tr_peerIoSetIOMode( c, EV_READ, 0 );
    102101            case READ_DONE:
    103102                done = 1;
     
    119118***
    120119**/
     120
     121void bufferevent_setwatermark(struct bufferevent *, short, size_t, size_t);
    121122
    122123static tr_peerIo*
     
    143144    bufferevent_settimeout( c->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS );
    144145    bufferevent_enable( c->bufev, EV_READ|EV_WRITE );
     146    bufferevent_setwatermark( c->bufev, EV_READ, 0, 1024 );
     147
    145148    return c;
    146149}
     
    234237}
    235238
     239void
     240tr_peerIoTryRead( tr_peerIo * io )
     241{
     242    if( EVBUFFER_LENGTH( io->bufev->input ) )
     243        canReadWrapper( io->bufev, io );
     244}
     245
    236246void
    237247tr_peerIoSetIOFuncs( tr_peerIo          * io,
     
    246256    io->userData = userData;
    247257
    248     if( EVBUFFER_LENGTH( io->bufev->input ) )
    249         canReadWrapper( io->bufev, io );
    250 }
    251 
    252 void
    253 tr_peerIoSetIOMode( tr_peerIo * io, short enable, short disable )
    254 {
    255     assert( tr_amInEventThread( io->handle ) );
    256     bufferevent_enable( io->bufev, enable );
    257     bufferevent_disable( io->bufev, disable );
     258    tr_peerIoTryRead( io );
    258259}
    259260
     
    285286        bufferevent_settimeout( io->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS );
    286287        bufferevent_enable( io->bufev, EV_READ|EV_WRITE );
     288        bufferevent_setwatermark( io->bufev, EV_READ, 0, 1024 );
    287289
    288290        return 0;
Note: See TracChangeset for help on using the changeset viewer.