diff --git a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java index 72fd08d3b..a97e768d8 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java @@ -105,7 +105,7 @@ public class I2PSocketManagerFull implements I2PSocketManager { } public I2PSocket receiveSocket() throws I2PException { - if (_session.isClosed()) throw new I2PException("Session closed"); + verifySession(); Connection con = _connectionManager.getConnectionHandler().accept(-1); if (_log.shouldLog(Log.DEBUG)) _log.debug("receiveSocket() called: " + con); @@ -149,6 +149,12 @@ public class I2PSocketManagerFull implements I2PSocketManager { return _serverSocket; } + private void verifySession() throws I2PException { + if (!_connectionManager.getSession().isClosed()) + return; + _connectionManager.getSession().connect(); + } + /** * Create a new connected socket (block until the socket is created) * @@ -160,8 +166,7 @@ public class I2PSocketManagerFull implements I2PSocketManager { */ public I2PSocket connect(Destination peer, I2PSocketOptions options) throws I2PException, NoRouteToHostException { - if (_connectionManager.getSession().isClosed()) - throw new I2PException("Session is closed"); + verifySession(); if (options == null) options = _defaultOptions; ConnectionOptions opts = null; diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/I2PSessionImpl.java index 10a3ee4e6..8fc8e6073 100644 --- a/core/java/src/net/i2p/client/I2PSessionImpl.java +++ b/core/java/src/net/i2p/client/I2PSessionImpl.java @@ -225,6 +225,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa */ public void connect() throws I2PSessionException { _closed = false; + _availabilityNotifier.stopNotifying(); I2PThread notifier = new I2PThread(_availabilityNotifier); notifier.setName("Notifier " + _myDestination.calculateHash().toBase64().substring(0,4)); notifier.setDaemon(true); diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index d3424f9d0..eb7da34bc 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.145 $ $Date: 2005/02/21 13:02:16 $"; + public final static String ID = "$Revision: 1.146 $ $Date: 2005/02/22 02:07:33 $"; public final static String VERSION = "0.5"; - public final static long BUILD = 4; + public final static long BUILD = 5; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/client/ClientConnectionRunner.java b/router/java/src/net/i2p/router/client/ClientConnectionRunner.java index e3a1522ec..b0f88b2af 100644 --- a/router/java/src/net/i2p/router/client/ClientConnectionRunner.java +++ b/router/java/src/net/i2p/router/client/ClientConnectionRunner.java @@ -227,7 +227,10 @@ public class ClientConnectionRunner { } void disconnectClient(String reason) { - _log.error("Disconnecting the client: " + reason); + if (_log.shouldLog(Log.CRIT)) + _log.log(Log.CRIT, "Disconnecting the client (" + + _config.getDestination().calculateHash().toBase64().substring(0,4) + + ": " + reason); DisconnectMessage msg = new DisconnectMessage(); msg.setReason(reason); try { diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/RepublishLeaseSetJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/RepublishLeaseSetJob.java index de63efc1d..b45697621 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/RepublishLeaseSetJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/RepublishLeaseSetJob.java @@ -74,9 +74,11 @@ public class RepublishLeaseSetJob extends JobImpl { public OnFailure(RouterContext ctx) { super(ctx); } public String getName() { return "Publish leaseSet failed"; } public void runJob() { - if (_log.shouldLog(Log.ERROR)) - _log.error("FAILED publishing of the leaseSet for " + _dest.toBase64()); - getContext().jobQueue().addJob(new RepublishLeaseSetJob(getContext(), _facade, _dest)); + if (_log.shouldLog(Log.WARN)) + _log.warn("FAILED publishing of the leaseSet for " + _dest.toBase64()); + LeaseSet ls = _facade.lookupLeaseSetLocally(_dest); + if ( (ls != null) && (ls.isCurrent(0)) ) + getContext().jobQueue().addJob(new RepublishLeaseSetJob(getContext(), _facade, _dest)); } } }