Changeset ac9392b


Ignore:
Timestamp:
Jun 23, 2013 3:21:40 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4970fd2
Parents:
5ba86ca
Message:
  • i2psnark: When receiving a metainfo via magnet and saving it to disk, preserve all non-standard fields (such as those created by Robert) so the infohash doesn't change on restart, splitting the swarm. (http://zzz.i2p/topics/1327 thx 'backup')
Files:
3 edited

Legend:

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

    r5ba86ca rac9392b  
    502502   * announce URL.
    503503   * Drops any announce-list.
    504    */
    505   public MetaInfo reannounce(String announce)
    506   {
    507     return new MetaInfo(announce, name, name_utf8, files,
    508                         lengths, piece_length,
    509                         piece_hashes, length, privateTorrent, null);
     504   * Preserves infohash and info map, including any non-standard fields.
     505   * @param announce may be null
     506   */
     507  public MetaInfo reannounce(String announce) throws InvalidBEncodingException
     508  {
     509        Map<String, BEValue> m = new HashMap();
     510        if (announce != null)
     511            m.put("announce", new BEValue(DataHelper.getUTF8(announce)));
     512        Map info = createInfoMap();
     513        m.put("info", new BEValue(info));
     514        return new MetaInfo(m);
    510515  }
    511516
     
    540545    if (infoMap != null)
    541546        return Collections.unmodifiableMap(infoMap);
     547    // we should only get here if serving a magnet on a torrent we created
     548    if (_log.shouldLog(Log.WARN))
     549        _log.warn("Creating new infomap", new Exception());
    542550    // otherwise we must create it
    543551    Map info = new HashMap();
  • history.txt

    r5ba86ca rac9392b  
     12013-06-23 zzz
     2 * i2psnark: When receiving a metainfo via magnet and saving it to disk,
     3   preserve all non-standard fields (such as those created by Robert) so the
     4   infohash doesn't change on restart and split the swarm.
     5
    162013-06-22 zzz
    27 * SSU:
  • router/java/src/net/i2p/router/RouterVersion.java

    r5ba86ca rac9392b  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 12;
     21    public final static long BUILD = 13;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.