forked from I2P_Developers/i2p.i2p
NTCP: Fix sending termination on idle timeout (ticket #2777)
This commit is contained in:
@ -302,8 +302,8 @@ class EventPumper implements Runnable {
|
||||
if ( con.getTimeSinceSend(now) > expire &&
|
||||
con.getTimeSinceReceive(now) > expire) {
|
||||
// we haven't sent or received anything in a really long time, so lets just close 'er up
|
||||
// con will cancel the key
|
||||
con.sendTerminationAndClose();
|
||||
key.cancel();
|
||||
if (_log.shouldInfo())
|
||||
_log.info("Failsafe or expire close for " + con);
|
||||
failsafeCloses++;
|
||||
|
@ -1043,8 +1043,8 @@ public class NTCPConnection implements Closeable {
|
||||
|
||||
/**
|
||||
* NTCP 1 or 2.
|
||||
* For NTCP1, sends termination and then closes the connection after a brief delay.
|
||||
* For NTCP2, simply closes the connection immediately.
|
||||
* For NTCP1, simply closes the connection immediately.
|
||||
* For NTCP2, sends termination and then closes the connection after a brief delay.
|
||||
*
|
||||
* @since 0.9.36
|
||||
*/
|
||||
@ -1066,6 +1066,8 @@ public class NTCPConnection implements Closeable {
|
||||
* @since 0.9.36
|
||||
*/
|
||||
private void sendTermination(int reason, int validFramesRcvd) {
|
||||
// So we don't get called again by the event pumper idle closer
|
||||
_lastSendTime = _context.clock().now();
|
||||
// TODO add param to clear queues?
|
||||
// no synch needed, sendNTCP2() is synched
|
||||
if (_log.shouldInfo())
|
||||
|
Reference in New Issue
Block a user