Changeset f7337b4


Ignore:
Timestamp:
Mar 8, 2015 8:19:12 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6e3cf78
Parents:
55161de
Message:

i2psnark: Increase min and default bandwidth
Add creation date to created torrents
log tweaks
more test cases

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

Legend:

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

    r55161de rf7337b4  
    7575    public static final int DEFAULT_STARTUP_DELAY = 3;
    7676    public static final boolean DEFAULT_USE_OPENTRACKERS = true;
    77     public static final int DEFAULT_MAX_UP_BW = 8;  //KBps
    7877    public static final int MAX_CONNECTIONS = 16; // per torrent
    7978    public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond";
     
    9897        _banlist = new ConcurrentHashSet<Hash>();
    9998        _maxUploaders = Snark.MAX_TOTAL_UPLOADERS;
    100         _maxUpBW = DEFAULT_MAX_UP_BW;
     99        _maxUpBW = SnarkManager.DEFAULT_MAX_UP_BW;
    101100        _maxConnections = MAX_CONNECTIONS;
    102101        _startupDelay = DEFAULT_STARTUP_DELAY;
  • apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java

    r55161de rf7337b4  
    9393    this.comment = null;
    9494    this.created_by = null;
    95     this.creation_date = 0;
     95    this.creation_date = I2PAppContext.getGlobalContext().clock().now();
    9696
    9797    // TODO if we add a parameter for other keys
     
    445445  /**
    446446   * The creation date (ms) or zero.
    447    * Not available for locally-created torrents.
     447   * As of 0.9.19, available for locally-created torrents.
    448448   * @since 0.9.7
    449449   */
     
    596596        if (announce_list != null)
    597597            m.put("announce-list", announce_list);
     598        // misc. optional  top-level stuff
     599        if (comment != null)
     600            m.put("comment", comment);
     601        if (created_by != null)
     602            m.put("created by", created_by);
     603        if (creation_date != 0)
     604            m.put("creation date", creation_date / 1000);
     605
    598606        Map<String, BEValue> info = createInfoMap();
    599607        m.put("info", info);
  • apps/i2psnark/java/src/org/klomp/snark/PeerCheckerTask.java

    r55161de rf7337b4  
    7676        int uploadLimit = coordinator.allowedUploaders();
    7777        boolean overBWLimit = coordinator.overUpBWLimit();
     78        if (_log.shouldLog(Log.DEBUG))
     79            _log.debug("peers: " + peerList.size() + " limit: " + uploadLimit + " overBW? " + overBWLimit);
    7880        DHT dht = _util.getDHT();
    7981        for (Peer peer : peerList) {
  • apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java

    r55161de rf7337b4  
    14661466  {
    14671467    if (listener != null && listener.overUploadLimit(uploaders)) {
    1468         // if (_log.shouldLog(Log.DEBUG))
    1469         //   _log.debug("Over limit, uploaders was: " + uploaders);
     1468          if (_log.shouldLog(Log.DEBUG))
     1469             _log.debug("Over limit, uploaders was: " + uploaders);
    14701470        return uploaders - 1;
    14711471    } else if (uploaders < MAX_UPLOADERS)
  • apps/i2psnark/java/src/org/klomp/snark/Snark.java

    r55161de rf7337b4  
    12891289    }
    12901290    int limit = _util.getMaxUploaders();
    1291     // debug("Total uploaders: " + totalUploaders + " Limit: " + limit, Snark.DEBUG);
     1291    if (_log.shouldLog(Log.DEBUG))
     1292        _log.debug("Total uploaders: " + totalUploaders + " Limit: " + limit);
    12921293    return totalUploaders > limit;
    12931294  }
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r55161de rf7337b4  
    119119    private static final String PROP_USE_DHT = "i2psnark.enableDHT";
    120120
    121     public static final int MIN_UP_BW = 2;
    122     public static final int DEFAULT_MAX_UP_BW = 10;
     121    public static final int MIN_UP_BW = 10;
     122    public static final int DEFAULT_MAX_UP_BW = 25;
    123123    public static final int DEFAULT_STARTUP_DELAY = 3;
    124124    public static final int DEFAULT_REFRESH_DELAY_SECS = 60;
Note: See TracChangeset for help on using the changeset viewer.