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

Skip to content
Snippets Groups Projects
Commit 38c02b44 authored by zzz's avatar zzz
Browse files

Streaming: final, volatile, logging

parent 04a59689
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ class ConnectionHandler { ...@@ -21,7 +21,7 @@ class ConnectionHandler {
private final Log _log; private final Log _log;
private final ConnectionManager _manager; private final ConnectionManager _manager;
private final LinkedBlockingQueue<Packet> _synQueue; private final LinkedBlockingQueue<Packet> _synQueue;
private boolean _active; private volatile boolean _active;
private int _acceptTimeout; private int _acceptTimeout;
/** max time after receiveNewSyn() and before the matched accept() */ /** max time after receiveNewSyn() and before the matched accept() */
...@@ -230,7 +230,8 @@ class ConnectionHandler { ...@@ -230,7 +230,8 @@ class ConnectionHandler {
} }
private class TimeoutSyn implements SimpleTimer.TimedEvent { private class TimeoutSyn implements SimpleTimer.TimedEvent {
private Packet _synPacket; private final Packet _synPacket;
public TimeoutSyn(Packet packet) { public TimeoutSyn(Packet packet) {
_synPacket = packet; _synPacket = packet;
} }
...@@ -239,12 +240,15 @@ class ConnectionHandler { ...@@ -239,12 +240,15 @@ class ConnectionHandler {
boolean removed = _synQueue.remove(_synPacket); boolean removed = _synQueue.remove(_synPacket);
if (removed) { if (removed) {
if (_synPacket.isFlagSet(Packet.FLAG_SYNCHRONIZE)) if (_synPacket.isFlagSet(Packet.FLAG_SYNCHRONIZE)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Expired on the SYN queue: " + _synPacket);
// timeout - send RST // timeout - send RST
sendReset(_synPacket); sendReset(_synPacket);
else } else {
// non-syn packet got stranded on the syn queue, send it to the con // non-syn packet got stranded on the syn queue, send it to the con
reReceivePacket(_synPacket); reReceivePacket(_synPacket);
}
} else { } else {
// handled. noop // handled. noop
} }
......
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