2005-12-14 jrandom
* Fix to drop peer references when we shitlist people again (thanks zzz!) * Further I2PSnark fixes to deal with arbitrary torrent info attributes (thanks Complication!)
This commit is contained in:
@ -55,6 +55,7 @@ public class MetaInfo
|
|||||||
private final int piece_length;
|
private final int piece_length;
|
||||||
private final byte[] piece_hashes;
|
private final byte[] piece_hashes;
|
||||||
private final long length;
|
private final long length;
|
||||||
|
private final Map infoMap;
|
||||||
|
|
||||||
private byte[] torrentdata;
|
private byte[] torrentdata;
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ public class MetaInfo
|
|||||||
this.length = length;
|
this.length = length;
|
||||||
|
|
||||||
this.info_hash = calculateInfoHash();
|
this.info_hash = calculateInfoHash();
|
||||||
|
infoMap = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +115,7 @@ public class MetaInfo
|
|||||||
if (val == null)
|
if (val == null)
|
||||||
throw new InvalidBEncodingException("Missing info map");
|
throw new InvalidBEncodingException("Missing info map");
|
||||||
Map info = val.getMap();
|
Map info = val.getMap();
|
||||||
|
infoMap = info;
|
||||||
|
|
||||||
val = (BEValue)info.get("name");
|
val = (BEValue)info.get("name");
|
||||||
if (val == null)
|
if (val == null)
|
||||||
@ -124,7 +127,7 @@ public class MetaInfo
|
|||||||
name_utf8 = val.getString();
|
name_utf8 = val.getString();
|
||||||
else
|
else
|
||||||
name_utf8 = null;
|
name_utf8 = null;
|
||||||
|
|
||||||
val = (BEValue)info.get("piece length");
|
val = (BEValue)info.get("piece length");
|
||||||
if (val == null)
|
if (val == null)
|
||||||
throw new InvalidBEncodingException("Missing piece length number");
|
throw new InvalidBEncodingException("Missing piece length number");
|
||||||
@ -378,6 +381,10 @@ public class MetaInfo
|
|||||||
private Map createInfoMap()
|
private Map createInfoMap()
|
||||||
{
|
{
|
||||||
Map info = new HashMap();
|
Map info = new HashMap();
|
||||||
|
if (infoMap != null) {
|
||||||
|
info.putAll(infoMap);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
info.put("name", name);
|
info.put("name", name);
|
||||||
if (name_utf8 != null)
|
if (name_utf8 != null)
|
||||||
info.put("name.utf-8", name_utf8);
|
info.put("name.utf-8", name_utf8);
|
||||||
|
@ -170,6 +170,9 @@ public class BEValue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** return the untyped value */
|
||||||
|
public Object getValue() { return value; }
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
String valueString;
|
String valueString;
|
||||||
|
@ -62,6 +62,8 @@ public class BEncoder
|
|||||||
bencode((List)o, out);
|
bencode((List)o, out);
|
||||||
else if (o instanceof Map)
|
else if (o instanceof Map)
|
||||||
bencode((Map)o, out);
|
bencode((Map)o, out);
|
||||||
|
else if (o instanceof BEValue)
|
||||||
|
bencode(((BEValue)o).getValue(), out);
|
||||||
else
|
else
|
||||||
throw new IllegalArgumentException("Cannot bencode: " + o.getClass());
|
throw new IllegalArgumentException("Cannot bencode: " + o.getClass());
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
$Id: history.txt,v 1.353 2005/12/13 04:38:52 jrandom Exp $
|
$Id: history.txt,v 1.354 2005/12/13 16:56:41 jrandom Exp $
|
||||||
|
|
||||||
|
2005-12-14 jrandom
|
||||||
|
* Fix to drop peer references when we shitlist people again (thanks zzz!)
|
||||||
|
* Further I2PSnark fixes to deal with arbitrary torrent info attributes
|
||||||
|
(thanks Complication!)
|
||||||
|
|
||||||
2005-12-13 zzz
|
2005-12-13 zzz
|
||||||
* Don't test tunnels expiring within 90 seconds
|
* Don't test tunnels expiring within 90 seconds
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.309 $ $Date: 2005/12/09 03:05:48 $";
|
public final static String ID = "$Revision: 1.310 $ $Date: 2005/12/13 16:56:42 $";
|
||||||
public final static String VERSION = "0.6.1.7";
|
public final static String VERSION = "0.6.1.7";
|
||||||
public final static long BUILD = 3;
|
public final static long BUILD = 4;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
@ -82,7 +82,7 @@ public class Shitlist {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//_context.netDb().fail(peer);
|
_context.netDb().fail(peer);
|
||||||
//_context.tunnelManager().peerFailed(peer);
|
//_context.tunnelManager().peerFailed(peer);
|
||||||
_context.messageRegistry().peerFailed(peer);
|
_context.messageRegistry().peerFailed(peer);
|
||||||
return wasAlready;
|
return wasAlready;
|
||||||
|
Reference in New Issue
Block a user