Ignore:
Timestamp:
Jul 1, 2012, 2:00:02 AM (9 years ago)
Author:
jordan
Message:

(trunk libT) #4931 "Wrong peer percentages for magnetized transfers" -- fixed.

tr_peerUpdateProgress() is guessing at the progress size, but when we don't have the data size yet that guess isn't very good. Add boundary

clamps on the peer.progress field.

File:
1 edited

Legend:

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

    r13329 r13360  
    24952495
    24962496        if( tr_torrentHasMetadata( tor ) )
     2497        {
    24972498            peer->progress = true_count / tor->info.pieceCount;
     2499        }
    24982500        else /* without pieceCount, this result is only a best guess... */
     2501        {
    24992502            peer->progress = true_count / ( have->bit_count + 1 );
    2500     }
     2503        }
     2504    }
     2505
     2506    /* clamp the progress range */
     2507    if ( peer->progress < 0.0 )
     2508        peer->progress = 0.0;
     2509    if ( peer->progress > 1.0 )
     2510        peer->progress = 1.0;
    25012511
    25022512    if( peer->atom && ( peer->progress >= 1.0 ) )
Note: See TracChangeset for help on using the changeset viewer.