Ignore:
Timestamp:
Feb 13, 2009, 6:23:56 PM (13 years ago)
Author:
charles
Message:

(trunk) #1787: add support for seeding ratio limiting in libtransmission

File:
1 edited

Legend:

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

    r7811 r7888  
    8787didWriteWrapper( tr_peerIo * io, size_t bytes_transferred )
    8888{
    89     while( bytes_transferred )
    90     {
     89     while( bytes_transferred && tr_isPeerIo( io ) )
     90     {
    9191        struct tr_datatype * next = __tr_list_entry( io->outbuf_datatypes.next, struct tr_datatype, head );
    9292        const size_t payload = MIN( next->length, bytes_transferred );
     
    100100        if( io->didWrite )
    101101            io->didWrite( io, payload, next->isPieceData, io->userData );
    102 
    103         bytes_transferred -= payload;
    104         next->length -= payload;
    105         if( !next->length ) {
    106             __tr_list_remove( io->outbuf_datatypes.next );
    107             tr_free( next );
    108         }
     102       
     103        if( tr_isPeerIo( io ) )
     104        {
     105            bytes_transferred -= payload;
     106            next->length -= payload;
     107            if( !next->length ) {
     108                __tr_list_remove( io->outbuf_datatypes.next );
     109                tr_free( next );
     110            }
     111        }
    109112    }
    110113}
Note: See TracChangeset for help on using the changeset viewer.