Changeset 10872f7


Ignore:
Timestamp:
May 22, 2012 6:18:30 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0f321f1
Parents:
20567ae
Message:
  • Prevent torrent shutdown when changing file priority to skip
Location:
apps/i2psnark/java/src/org/klomp/snark
Files:
2 edited

Legend:

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

    r20567ae r10872f7  
    425425 
    426426  /**
     427   *  @return good
    427428   *  @since 0.9.1
    428429   */
    429   boolean checkPiece(PartialPiece pp) throws IOException {
     430  boolean checkPiece(PartialPiece pp) {
    430431    MessageDigest sha1 = SHA1.getInstance();
    431432    int piece = pp.getPiece();
    432 
    433     byte[] hash = pp.getHash();
     433    byte[] hash;
     434    try {
     435        hash = pp.getHash();
     436    } catch (IOException ioe) {
     437        // Could be caused by closing a peer connnection
     438        // we don't want the exception to propagate through
     439        // to Storage.putPiece()
     440        _log.warn("Error checking", ioe);
     441        return false;
     442    }
    434443    for (int i = 0; i < 20; i++)
    435444      if (hash[i] != piece_hashes[20 * piece + i])
  • apps/i2psnark/java/src/org/klomp/snark/PeerState.java

    r20567ae r10872f7  
    309309
    310310    // Last chunk needed for this piece?
     311    // FIXME if priority changed to skip, we will think we're done when we aren't
    311312    if (getFirstOutstandingRequest(req.getPiece()) == -1)
    312313      {
Note: See TracChangeset for help on using the changeset viewer.