diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-22 17:33:40 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-22 17:33:40 -0700 |
commit | 4a10f75f016af996bd15e90101f0d20e4d61e083 (patch) | |
tree | e4c97cccd9b3371cea11679ec0966c8c62977625 /src/main/java/org/traccar/session/ConnectionManager.java | |
parent | 708f04be5d9a25bd9d217127680a61f307cb8ef2 (diff) | |
download | trackermap-server-4a10f75f016af996bd15e90101f0d20e4d61e083.tar.gz trackermap-server-4a10f75f016af996bd15e90101f0d20e4d61e083.tar.bz2 trackermap-server-4a10f75f016af996bd15e90101f0d20e4d61e083.zip |
Add device expiration (fix #3056, fix #3529)
Diffstat (limited to 'src/main/java/org/traccar/session/ConnectionManager.java')
-rw-r--r-- | src/main/java/org/traccar/session/ConnectionManager.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java index 9888cca2b..2d183ee22 100644 --- a/src/main/java/org/traccar/session/ConnectionManager.java +++ b/src/main/java/org/traccar/session/ConnectionManager.java @@ -136,7 +136,9 @@ public class ConnectionManager implements BroadcastInterface { device = addUnknownDevice(uniqueIds[0]); } - if (device != null && !device.getDisabled()) { + if (device != null) { + device.checkDisabled(); + DeviceSession oldSession = sessionsByDeviceId.remove(device.getId()); if (oldSession != null) { Endpoint oldEndpoint = new Endpoint(oldSession.getChannel(), oldSession.getRemoteAddress()); @@ -160,7 +162,7 @@ public class ConnectionManager implements BroadcastInterface { return deviceSession; } else { - LOGGER.warn((device == null ? "Unknown" : "Disabled") + " device - " + String.join(" ", uniqueIds) + LOGGER.warn("Unknown device - " + String.join(" ", uniqueIds) + " (" + ((InetSocketAddress) remoteAddress).getHostString() + ")"); return null; } |