forked from I2P_Developers/i2p.i2p
* 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')
This commit is contained in:
@ -501,12 +501,17 @@ public class MetaInfo
|
|||||||
* Creates a copy of this MetaInfo that shares everything except the
|
* Creates a copy of this MetaInfo that shares everything except the
|
||||||
* announce URL.
|
* announce URL.
|
||||||
* Drops any announce-list.
|
* Drops any announce-list.
|
||||||
|
* Preserves infohash and info map, including any non-standard fields.
|
||||||
|
* @param announce may be null
|
||||||
*/
|
*/
|
||||||
public MetaInfo reannounce(String announce)
|
public MetaInfo reannounce(String announce) throws InvalidBEncodingException
|
||||||
{
|
{
|
||||||
return new MetaInfo(announce, name, name_utf8, files,
|
Map<String, BEValue> m = new HashMap();
|
||||||
lengths, piece_length,
|
if (announce != null)
|
||||||
piece_hashes, length, privateTorrent, null);
|
m.put("announce", new BEValue(DataHelper.getUTF8(announce)));
|
||||||
|
Map info = createInfoMap();
|
||||||
|
m.put("info", new BEValue(info));
|
||||||
|
return new MetaInfo(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -539,6 +544,9 @@ public class MetaInfo
|
|||||||
// or else we will lose any non-standard keys and corrupt the infohash.
|
// or else we will lose any non-standard keys and corrupt the infohash.
|
||||||
if (infoMap != null)
|
if (infoMap != null)
|
||||||
return Collections.unmodifiableMap(infoMap);
|
return Collections.unmodifiableMap(infoMap);
|
||||||
|
// we should only get here if serving a magnet on a torrent we created
|
||||||
|
if (_log.shouldLog(Log.WARN))
|
||||||
|
_log.warn("Creating new infomap", new Exception());
|
||||||
// otherwise we must create it
|
// otherwise we must create it
|
||||||
Map info = new HashMap();
|
Map info = new HashMap();
|
||||||
info.put("name", name);
|
info.put("name", name);
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2013-06-23 zzz
|
||||||
|
* 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 and split the swarm.
|
||||||
|
|
||||||
2013-06-22 zzz
|
2013-06-22 zzz
|
||||||
* SSU:
|
* SSU:
|
||||||
- Pad messages with random data instead of zeros
|
- Pad messages with random data instead of zeros
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 12;
|
public final static long BUILD = 13;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user