Changeset 7432


Ignore:
Timestamp:
Dec 17, 2008, 1:29:03 PM (12 years ago)
Author:
charles
Message:

(trunk libT) tweak the new peer IO code a bit to handle EINPROGRESS

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.c

    r7419 r7432  
    298298    tr_ptrArray * tmp;
    299299    struct tr_peerIo ** peers;
    300     const size_t chunkSize = 1024; /* arbitrary */
    301300
    302301    tmp = tr_ptrArrayNew( );
     
    313312        for( i=0; i<n; )
    314313        {
    315             const int byteCount = tr_peerIoFlush( peers[i], dir, chunkSize );
     314            const int increment = n==1 ? 4096 : 1024;
     315            const int byteCount = tr_peerIoFlush( peers[i], dir, increment);
    316316
    317317            if( byteCount )
    318318                fprintf( stderr, "peer %p: %d bytes\n", peers[i], byteCount );
    319319
    320             if( byteCount == (int)chunkSize )
     320            if( byteCount == increment )
    321321                ++i;
    322322            else
  • trunk/libtransmission/peer-io.c

    r7419 r7432  
    808808        canReadWrapper( io, res, io );
    809809
    810     if( ( res <= 0 ) && ( io->gotError ) && ( errno != EAGAIN ) && ( errno != EINTR ) )
     810    if( ( res <= 0 ) && ( io->gotError ) && ( errno != EAGAIN ) && ( errno != EINTR ) && ( errno != EINPROGRESS ) )
    811811    {
    812812        short what = EVBUFFER_READ | EVBUFFER_ERROR;
Note: See TracChangeset for help on using the changeset viewer.