I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 39e8e93b authored by zzz's avatar zzz
Browse files

propagate from branch 'i2p.i2p.zzz.test' (head c25c24d91060673157085b8c6edeb35e35e57900)

            to branch 'i2p.i2p' (head a28a9a5e42fadc0ad8780ec708f17928cfdf2e66)
parents 609e7069 e151ef74
No related branches found
No related tags found
No related merge requests found
......@@ -839,6 +839,8 @@ public class Connection {
setFuzz(5*1000); // sloppy timer, don't reschedule unless at least 5s later
}
public void timeReached() {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Fire inactivity timer on " + Connection.this.toString());
// uh, nothing more to do...
if (!_connected) {
if (_log.shouldLog(Log.DEBUG)) _log.debug("Inactivity timeout reached, but we are already closed");
......@@ -864,6 +866,9 @@ public class Connection {
// if one of us can't talk...
// No - not true - data and acks are still going back and forth.
// Prevent zombie connections by keeping the inactivity timer.
// Not sure why... receiving a close but never sending one?
// If so we can probably re-enable this for _closeSentOn.
// For further investigation...
//if ( (_closeSentOn > 0) || (_closeReceivedOn > 0) ) {
// if (_log.shouldLog(Log.DEBUG)) _log.debug("Inactivity timeout reached, but we are closing");
// return;
......@@ -873,15 +878,17 @@ public class Connection {
// bugger it, might as well do the hard work now
switch (_options.getInactivityAction()) {
case ConnectionOptions.INACTIVITY_ACTION_SEND:
if (_log.shouldLog(Log.WARN))
_log.warn("Sending some data due to inactivity");
_receiver.send(null, 0, 0, true);
break;
case ConnectionOptions.INACTIVITY_ACTION_NOOP:
if (_log.shouldLog(Log.WARN))
_log.warn("Inactivity timer expired, but we aint doin' shit");
break;
case ConnectionOptions.INACTIVITY_ACTION_SEND:
if (_closeSentOn <= 0 && _closeReceivedOn <= 0) {
if (_log.shouldLog(Log.WARN))
_log.warn("Sending some data due to inactivity");
_receiver.send(null, 0, 0, true);
break;
} // else fall through
case ConnectionOptions.INACTIVITY_ACTION_DISCONNECT:
// fall through
default:
......@@ -897,7 +904,9 @@ public class Connection {
_inputStream.streamErrorOccurred(new IOException("Inactivity timeout"));
_outputStream.streamErrorOccurred(new IOException("Inactivity timeout"));
disconnect(false);
// Clean disconnect if we have already scheduled one
// (generally because we already sent a close)
disconnect(_disconnectScheduledOn >= 0);
break;
}
}
......@@ -1046,7 +1055,9 @@ public class Connection {
if (_packet.getAckTime() > 0)
return false;
if (_resetSent || _resetReceived) {
if (_resetSent || _resetReceived || !_connected) {
if(_log.shouldLog(Log.WARN) && (!_resetSent) && (!_resetReceived))
_log.warn("??? no resets but not connected: " + _packet); // don't think this is possible
_packet.cancelled();
return false;
}
......
......@@ -71,7 +71,8 @@ class ConnectionHandler {
if (!_active) {
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping new SYN request, as we're not listening");
sendReset(packet);
if (packet.isFlagSet(Packet.FLAG_SYNCHRONIZE))
sendReset(packet);
return;
}
if (_log.shouldLog(Log.DEBUG))
......
......@@ -41,6 +41,8 @@ import net.i2p.util.Log;
* <li>{@link #FLAG_DELAY_REQUESTED}: 2 byte integer</li>
* <li>{@link #FLAG_MAX_PACKET_SIZE_INCLUDED}: 2 byte integer</li>
* <li>{@link #FLAG_PROFILE_INTERACTIVE}: no option data</li>
* <li>{@link #FLAG_ECHO}: no option data</li>
* <li>{@link #FLAG_NO_ACK}: no option data</li>
* </ol>
*
* <p>If the signature is included, it uses the Destination's DSA key
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment