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) {} try { _synQueue.wait(); } catch (InterruptedException ie) {}
} else { } else {
long remaining = expiration - _context.clock().now(); 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; break;
try { _synQueue.wait(remaining); } catch (InterruptedException ie) {} try { _synQueue.wait(remaining); } catch (InterruptedException ie) {}
} }

View File

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