Changeset 12fae66


Ignore:
Timestamp:
Dec 26, 2010 12:27:40 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7e229cce
Parents:
b97ad6c5
Message:
  • Fix about 9 NPEs
  • Fix numwant in magnet mode
  • Send metadata size in extension handshake
  • Open trackers are primary if we don't have primary trackers
  • Add missing break in port message handling
  • Increase max msg size to account for metadata msg
  • Remember magnets across restarts
  • Drop peers w/o extensions if we need metainfo
  • Fix DATA messages
  • Fix tracker transition to non-magnet
  • Fix infohash for non-magnet
  • Fix up peer transition to non-magnet
  • More logging
Location:
apps/i2psnark/java/src/org/klomp/snark
Files:
2 edited

Legend:

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

    rb97ad6c5 r12fae66  
    5151    throws IOException, IllegalArgumentException
    5252  {
     53    if (o == null)
     54      throw new NullPointerException("Cannot bencode null");
    5355    if (o instanceof String)
    5456      bencode((String)o, out);
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    rb97ad6c5 r12fae66  
    3636import net.i2p.util.SecureFileOutputStream;
    3737
     38import org.klomp.snark.I2PSnarkUtil;
    3839import org.klomp.snark.MetaInfo;
    3940import org.klomp.snark.Peer;
     
    13901391            return;
    13911392        }
    1392         _manager.addMagnet(name, ih);
     1393        _manager.addMagnet(name, ih, true);
    13931394    }
    13941395
     
    15751576            buf.append("<br>").append(_("Pieces")).append(": ").append(pieces);
    15761577            buf.append("<br>").append(_("Piece size")).append(": ").append(formatSize(snark.getPieceLength(0)));
    1577             String hex = toHex(snark.getInfoHash());
     1578            String hex = I2PSnarkUtil.toHex(snark.getInfoHash());
    15781579            buf.append("<br>").append(_("Magnet link")).append(": <a href=\"").append(MAGNET).append(hex).append("\">")
    15791580               .append(MAGNET).append(hex).append("</a>");
     
    18001801    }
    18011802
    1802     /**
    1803      *  Like DataHelper.toHexString but ensures no loss of leading zero bytes
    1804      *  @since 0.8.4
    1805      */
    1806     private static String toHex(byte[] b) {
    1807         StringBuilder buf = new StringBuilder(40);
    1808         for (int i = 0; i < b.length; i++) {
    1809             int bi = b[i] & 0xff;
    1810             if (bi < 16)
    1811                 buf.append('0');
    1812             buf.append(Integer.toHexString(bi));
    1813         }
    1814         return buf.toString();
    1815     }
    1816 
    18171803    /** @since 0.8.1 */
    18181804    private void savePriorities(Snark snark, Map postParams) {
Note: See TracChangeset for help on using the changeset viewer.