forked from I2P_Developers/i2p.i2p
Streaming: Kill accept() when session disconnects
This commit is contained in:
@ -54,15 +54,14 @@ class ConnectionHandler {
|
|||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.WARN))
|
||||||
_log.warn("setActive(" + active + ") called, previously " + _active, new Exception("I did it"));
|
_log.warn("setActive(" + active + ") called, previously " + _active, new Exception("I did it"));
|
||||||
// if starting, clear any old poison
|
// if starting, clear any old poison
|
||||||
// if stopping, the accept() loop will clear any pending sockets
|
|
||||||
if (active && !_active)
|
if (active && !_active)
|
||||||
_synQueue.clear();
|
_synQueue.clear();
|
||||||
boolean wasActive = _active;
|
boolean wasActive = _active;
|
||||||
_active = active;
|
_active = active;
|
||||||
if (wasActive && !active) {
|
if (wasActive && !active) {
|
||||||
try {
|
// stopping, clear any pending sockets
|
||||||
_synQueue.put(new PoisonPacket()); // so we break from the accept() - waits until space is available
|
_synQueue.clear();
|
||||||
} catch (InterruptedException ie) {}
|
_synQueue.offer(new PoisonPacket());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +103,8 @@ class MessageHandler implements I2PSessionMuxedListener {
|
|||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.WARN))
|
||||||
_log.warn("I2PSession disconnected");
|
_log.warn("I2PSession disconnected");
|
||||||
_manager.disconnectAllHard();
|
_manager.disconnectAllHard();
|
||||||
|
// kill anybody waiting in accept()
|
||||||
|
_manager.getConnectionHandler().setActive(false);
|
||||||
|
|
||||||
for (I2PSocketManager.DisconnectListener lsnr : _listeners) {
|
for (I2PSocketManager.DisconnectListener lsnr : _listeners) {
|
||||||
lsnr.sessionDisconnected();
|
lsnr.sessionDisconnected();
|
||||||
@ -119,9 +121,7 @@ class MessageHandler implements I2PSessionMuxedListener {
|
|||||||
*/
|
*/
|
||||||
public void errorOccurred(I2PSession session, String message, Throwable error) {
|
public void errorOccurred(I2PSession session, String message, Throwable error) {
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.WARN))
|
||||||
_log.warn("error occurred: " + message + "- " + error.getMessage());
|
_log.warn("error occurred: " + message + "- " + error.getMessage(), error);
|
||||||
if (_log.shouldLog(Log.WARN))
|
|
||||||
_log.warn("cause", error);
|
|
||||||
//_manager.disconnectAllHard();
|
//_manager.disconnectAllHard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2016-06-26 zzz
|
2016-07-16 zzz
|
||||||
|
* I2CP Client: Handle disconnect properly if received before first LS
|
||||||
|
* Streaming: Kill accept() when session disconnects
|
||||||
|
|
||||||
|
2016-06-25 zzz
|
||||||
* SSU peer testing: Add implementation (ticket #1752; proposal #126)
|
* SSU peer testing: Add implementation (ticket #1752; proposal #126)
|
||||||
|
* Utils: Improve random seed initialization
|
||||||
|
|
||||||
2016-06-22 zzz
|
2016-06-22 zzz
|
||||||
* SSU peer testing:
|
* SSU peer testing:
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 3;
|
public final static long BUILD = 4;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user