- Hide I2CP settings when in router context

- Better BEValue.toString()

(most of the following got missed in the last checkin)
- Fix about 9 NPEs
- Fix numwant in magnet mode
- Send metadata size in extension handshake
- Open trackers are primary if we don't have primary trackers
- Add missing break in port message handling
- Increase max msg size to account for metadata msg
- Remember magnets across restarts
- Drop peers w/o extensions if we need metainfo
- Fix DATA messages
- Fix tracker transition to non-magnet
- Fix infohash for non-magnet
- Fix up peer transition to non-magnet
- More logging
This commit is contained in:
zzz
2010-12-27 17:13:24 +00:00
parent bebd6b2022
commit 71043c41f1
14 changed files with 213 additions and 77 deletions

View File

@@ -24,6 +24,8 @@ import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
import net.i2p.data.Base64;
/**
* Holds different types that a bencoded byte array can represent.
* You need to call the correct get method to get the correct java
@@ -180,10 +182,14 @@ public class BEValue
{
byte[] bs = (byte[])value;
// XXX - Stupid heuristic... and not UTF-8
if (bs.length <= 12)
valueString = new String(bs);
//if (bs.length <= 12)
// valueString = new String(bs);
//else
// valueString = "bytes:" + bs.length;
if (bs.length <= 32)
valueString = bs.length + " bytes: " + Base64.encode(bs);
else
valueString = "bytes:" + bs.length;
valueString = bs.length + " bytes";
}
else
valueString = value.toString();