forked from I2P_Developers/i2p.i2p
I2CP: Soft restart fixes part 3
Remove low-level I2CP reconnector as it may result in duplicate destinations after higher-level (i2ptunnel) or application-layer reconnections Root cause identified by BiglyBT Gitlab issue #350
This commit is contained in:
@@ -32,23 +32,7 @@ class DisconnectMessageHandler extends HandlerImpl {
|
|||||||
String reason = ((DisconnectMessage)message).getReason();
|
String reason = ((DisconnectMessage)message).getReason();
|
||||||
session.propogateError(reason, new I2PSessionException("Disconnect Message received: " + reason));
|
session.propogateError(reason, new I2PSessionException("Disconnect Message received: " + reason));
|
||||||
session.destroySession(false);
|
session.destroySession(false);
|
||||||
if (reason.contains("restart")) {
|
// Higher layers (only) must do the reconnect, to prevent dup destinations
|
||||||
Thread t = new I2PAppThread(new Reconnector(session), "Reconnect " + session, true);
|
//if (reason.contains("restart")) ...
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @since 0.8.8 */
|
|
||||||
private static class Reconnector implements Runnable {
|
|
||||||
private final I2PSessionImpl _session;
|
|
||||||
|
|
||||||
public Reconnector(I2PSessionImpl session) {
|
|
||||||
_session = session;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run() {
|
|
||||||
try { Thread.sleep(40*1000); } catch (InterruptedException ie) {}
|
|
||||||
_session.reconnect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user