Changeset 1b9d870


Ignore:
Timestamp:
Nov 10, 2013 3:20:07 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
598ef67
Parents:
68f67b7
Message:

i2psnark: Don't announce more than torrent size as downloaded amount

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java

    r68f67b7 r1b9d870  
    474474                    long uploaded = coordinator.getUploaded();
    475475                    long downloaded = coordinator.getDownloaded();
     476                    long len = snark.getTotalLength();
     477                    if (len > 0 && downloaded > len)
     478                        downloaded = len;
    476479                    left = coordinator.getLeft();
    477480                    String event;
     
    509512                        coordinator.getPeerCount() <= 0 &&
    510513                        _util.getContext().clock().now() > _startedOn + 2*60*60*1000 &&
     514                        snark.getTotalLength() > 0 &&
    511515                        uploaded >= 2 * snark.getTotalLength()) {
    512516                        if (_log.shouldLog(Log.WARN))
     
    716720        long uploaded = coordinator.getUploaded();
    717721        long downloaded = coordinator.getDownloaded();
     722        long len = snark.getTotalLength();
     723        if (len > 0 && downloaded > len)
     724            downloaded = len;
    718725        long left = coordinator.getLeft();
    719726        try
Note: See TracChangeset for help on using the changeset viewer.