diff --git a/core/src/main/groovy/com/muwire/core/connection/Connection.groovy b/core/src/main/groovy/com/muwire/core/connection/Connection.groovy index 0c6e6708..a9a113f4 100644 --- a/core/src/main/groovy/com/muwire/core/connection/Connection.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/Connection.groovy @@ -35,7 +35,7 @@ abstract class Connection implements Closeable { private static final long INTERVAL = 1000 private static final MAX_PONGS_V1 = 2 - private static final MAX_PONGS_V2 = 3 + private static final MAX_PONGS_V2 = 4 final EventBus eventBus final Endpoint endpoint diff --git a/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy b/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy index 0712fa81..d7cc1a2c 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy @@ -23,7 +23,7 @@ import net.i2p.util.ConcurrentHashSet @Log class ConnectionEstablisher { - private static final int CONCURRENT = 4 + private static final int CONCURRENT = 8 final EventBus eventBus final I2PConnector i2pConnector diff --git a/core/src/main/groovy/com/muwire/core/connection/MessageUtil.groovy b/core/src/main/groovy/com/muwire/core/connection/MessageUtil.groovy index 416f03cc..2aff74f9 100644 --- a/core/src/main/groovy/com/muwire/core/connection/MessageUtil.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/MessageUtil.groovy @@ -51,7 +51,7 @@ class MessageUtil { byte count = dis.readByte() List destinations = new ArrayList<>(count) count.times { - destinations << Destination.create(dis) + destinations << Destination.create(dis).toBase64() } rv.pongs = destinations diff --git a/core/src/main/groovy/com/muwire/core/connection/PeerConnection.groovy b/core/src/main/groovy/com/muwire/core/connection/PeerConnection.groovy index dfd3401a..770e4dbb 100644 --- a/core/src/main/groovy/com/muwire/core/connection/PeerConnection.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/PeerConnection.groovy @@ -43,7 +43,7 @@ class PeerConnection extends Connection { protected void read() { dis.readFully(readHeader) int length = DataUtil.readLength(readHeader) - log.fine("$name read length $length") + log.fine("$name read length $length read header ${readHeader[0]}") if (length > MAX_PAYLOAD_SIZE) throw new Exception("Rejecting large message $length") @@ -52,7 +52,7 @@ class PeerConnection extends Connection { dis.readFully(payload) def json - if ((readHeader[0] & (byte)0x80) == 0x80) { + if ((readHeader[0] & (byte)0x80) == (byte)0x80) { json = MessageUtil.parseBinaryMessage(payload) } else { json = slurper.parse(payload)