From e243e0ddbabe3eaa1a864c3137855fd441794de5 Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 23 Aug 2018 15:20:29 +0000 Subject: [PATCH] streaming minor tweaks --- .../src/net/i2p/client/streaming/impl/ConnectionHandler.java | 4 ++-- .../net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java | 3 ++- .../src/net/i2p/client/streaming/impl/MessageInputStream.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionHandler.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionHandler.java index 213ee9c3a..478dfb76c 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionHandler.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionHandler.java @@ -64,8 +64,8 @@ class ConnectionHandler { public synchronized void setActive(boolean active) { // FIXME active=false this only kills for one thread in accept() // if there are more, they won't get a poison packet. - if (_log.shouldLog(Log.WARN)) - _log.warn("setActive(" + active + ") called, previously " + _active, new Exception("I did it")); + if (_log.shouldInfo()) + _log.info("setActive(" + active + ") called, previously " + _active, new Exception("I did it")); // if starting, clear any old poison if (active && !_active) { _restartPending = false; diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java index 903e48a85..1dd16901e 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java @@ -17,6 +17,7 @@ class I2PSocketOptionsImpl implements I2PSocketOptions { private int _remotePort; public static final int DEFAULT_BUFFER_SIZE = 1024*64; + public static final int DEFAULT_READ_TIMEOUT = -1; public static final int DEFAULT_WRITE_TIMEOUT = -1; public static final int DEFAULT_CONNECT_TIMEOUT = 60*1000; @@ -71,7 +72,7 @@ class I2PSocketOptionsImpl implements I2PSocketOptions { if (opts.getProperty(PROP_CONNECT_TIMEOUT) != null) _connectTimeout = getInt(opts, PROP_CONNECT_TIMEOUT, DEFAULT_CONNECT_TIMEOUT); if (opts.getProperty(PROP_READ_TIMEOUT) != null) - _readTimeout = getInt(opts, PROP_READ_TIMEOUT, -1); + _readTimeout = getInt(opts, PROP_READ_TIMEOUT, DEFAULT_READ_TIMEOUT); if (opts.getProperty(PROP_WRITE_TIMEOUT) != null) _writeTimeout = getInt(opts, PROP_WRITE_TIMEOUT, DEFAULT_WRITE_TIMEOUT); } diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/MessageInputStream.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/MessageInputStream.java index de7752cd6..ba73aa551 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/MessageInputStream.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/MessageInputStream.java @@ -74,7 +74,7 @@ class MessageInputStream extends InputStream { _readyDataBlocks = new ArrayList(4); _highestReadyBlockId = -1; _highestBlockId = -1; - _readTimeout = -1; + _readTimeout = I2PSocketOptionsImpl.DEFAULT_READ_TIMEOUT; _notYetReadyBlocks = new HashMap(4); _dataLock = new Object(); _maxMessageSize = maxMessageSize;