Changeset 6a54aa7


Ignore:
Timestamp:
Feb 5, 2011 10:42:07 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b08efb6, d8080278
Parents:
f046eb7
Message:

cleanups

Location:
apps/i2psnark/java/src/org/klomp/snark
Files:
5 edited

Legend:

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

    rf046eb7 r6a54aa7  
    3131    public static final String TYPE_METADATA = "ut_metadata";
    3232    public static final int ID_PEX = 2;
    33     public static final String TYPE_PEX = "ut_pex";
     33    /** not ut_pex since the compact format is different */
     34    public static final String TYPE_PEX = "i2p_pex";
    3435    /** Pieces * SHA1 Hash length, + 25% extra for file names, benconding overhead, etc */
    3536    private static final int MAX_METADATA_SIZE = Storage.MAX_PIECES * 20 * 5 / 4;
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    rf046eb7 r6a54aa7  
    7373    public static final int MAX_CONNECTIONS = 16; // per torrent
    7474    private static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond";
    75     private static final boolean ENABLE_DHT = true;
     75    //private static final boolean ENABLE_DHT = true;
    7676
    7777    public I2PSnarkUtil(I2PAppContext ctx) {
  • apps/i2psnark/java/src/org/klomp/snark/Peer.java

    rf046eb7 r6a54aa7  
    8080  static final long OPTION_FAST      = 0x0000000000000004l;
    8181  static final long OPTION_DHT       = 0x0000000000000001l;
     82  /** we use a different bit since the compact format is different */
     83  static final long OPTION_I2P_DHT   = 0x0000000040000000l;
    8284  static final long OPTION_AZMP      = 0x1000000000000000l;
    8385  private long options;
     
    270272        }
    271273
    272         if ((options & OPTION_DHT) != 0 && util.getDHT() != null) {
     274        if ((options & OPTION_I2P_DHT) != 0 && util.getDHT() != null) {
    273275            if (_log.shouldLog(Log.DEBUG))
    274276                _log.debug("Peer supports DHT, sending PORT message");
     
    328330    dout.write("BitTorrent protocol".getBytes("UTF-8"));
    329331    // Handshake write - options
    330     // FIXME not if DHT disabled
    331     dout.writeLong(OPTION_EXTENSION | OPTION_DHT);
     332    long myOptions = OPTION_EXTENSION;
     333    // FIXME get util here somehow
     334    //if (util.getDHT() != null)
     335    //    myOptions |= OPTION_I2P_DHT;
     336    dout.writeLong(myOptions);
    332337    // Handshake write - metainfo hash
    333338    dout.write(infohash);
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    rf046eb7 r6a54aa7  
    751751     * @since 0.8.4
    752752     */
    753     private void locked_writeMetaInfo(MetaInfo metainfo, String filename) throws IOException {
    754         // prevent interference by DirMonitor
     753    private static void locked_writeMetaInfo(MetaInfo metainfo, String filename) throws IOException {
    755754        File file = new File(filename);
    756755        if (file.exists())
     
    13141313                    snark.stopTorrent();
    13151314            }
    1316 //save magnets
    13171315        }
    13181316    }
  • apps/i2psnark/java/src/org/klomp/snark/dht/DHT.java

    rf046eb7 r6a54aa7  
    22
    33/*
    4  *  Copyright 2010 zzz (zzz@mail.i2p)
    54 *  GPLv2
    65 */
Note: See TracChangeset for help on using the changeset viewer.