Code cleanup in I2PSocketManagerFull and I2PServerSocketFull

BUGFIX ConnectionHandler had a comparason bug that caused it to block when infact it was asked NOT to block
This commit is contained in:
sponge
2008-10-06 09:28:59 +00:00
parent 0a5eeed370
commit f1c4a85991
3 changed files with 7 additions and 5 deletions

View File

@@ -95,7 +95,11 @@ class ConnectionHandler {
try { _synQueue.wait(); } catch (InterruptedException ie) {}
} else {
long remaining = expiration - _context.clock().now();
if (remaining < 0)
// BUGFIX
// The specified amount of real time has elapsed, more or less.
// If timeout is zero, however, then real time is not taken into consideration
// and the thread simply waits until notified.
if (remaining < 1)
break;
try { _synQueue.wait(remaining); } catch (InterruptedException ie) {}
}

View File

@@ -1,8 +1,6 @@
package net.i2p.client.streaming;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.i2p.I2PException;
/**

View File

@@ -128,8 +128,8 @@ public class I2PSocketManagerFull implements I2PSocketManager {
return sock;
} else {
if(_connectionManager.MgetSoTimeout() == -1) {
return null;
}
return null;
}
throw new SocketTimeoutException("I2PSocket timed out");
}
}