forked from I2P_Developers/i2p.i2p
streaming minor tweaks
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class MessageInputStream extends InputStream {
|
||||
_readyDataBlocks = new ArrayList<ByteArray>(4);
|
||||
_highestReadyBlockId = -1;
|
||||
_highestBlockId = -1;
|
||||
_readTimeout = -1;
|
||||
_readTimeout = I2PSocketOptionsImpl.DEFAULT_READ_TIMEOUT;
|
||||
_notYetReadyBlocks = new HashMap<Long, ByteArray>(4);
|
||||
_dataLock = new Object();
|
||||
_maxMessageSize = maxMessageSize;
|
||||
|
||||
Reference in New Issue
Block a user