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:
jrandom
2005-12-14 09:32:50 +00:00
committed by zzz
parent 5033a22a9b
commit 369b6930e5
6 changed files with 22 additions and 5 deletions

View File

@ -55,6 +55,7 @@ public class MetaInfo
private final int piece_length;
private final byte[] piece_hashes;
private final long length;
private final Map infoMap;
private byte[] torrentdata;
@ -72,6 +73,7 @@ public class MetaInfo
this.length = length;
this.info_hash = calculateInfoHash();
infoMap = null;
}
/**
@ -113,6 +115,7 @@ public class MetaInfo
if (val == null)
throw new InvalidBEncodingException("Missing info map");
Map info = val.getMap();
infoMap = info;
val = (BEValue)info.get("name");
if (val == null)
@ -124,7 +127,7 @@ public class MetaInfo
name_utf8 = val.getString();
else
name_utf8 = null;
val = (BEValue)info.get("piece length");
if (val == null)
throw new InvalidBEncodingException("Missing piece length number");
@ -378,6 +381,10 @@ public class MetaInfo
private Map createInfoMap()
{
Map info = new HashMap();
if (infoMap != null) {
info.putAll(infoMap);
return info;
}
info.put("name", name);
if (name_utf8 != null)
info.put("name.utf-8", name_utf8);

View File

@ -170,6 +170,9 @@ public class BEValue
}
}
/** return the untyped value */
public Object getValue() { return value; }
public String toString()
{
String valueString;

View File

@ -62,6 +62,8 @@ public class BEncoder
bencode((List)o, out);
else if (o instanceof Map)
bencode((Map)o, out);
else if (o instanceof BEValue)
bencode(((BEValue)o).getValue(), out);
else
throw new IllegalArgumentException("Cannot bencode: " + o.getClass());
}

View File

@ -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
* Don't test tunnels expiring within 90 seconds

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
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 long BUILD = 3;
public final static long BUILD = 4;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -82,7 +82,7 @@ public class Shitlist {
}
}
//_context.netDb().fail(peer);
_context.netDb().fail(peer);
//_context.tunnelManager().peerFailed(peer);
_context.messageRegistry().peerFailed(peer);
return wasAlready;