aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session/ConnectionManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-22 17:33:40 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-22 17:33:40 -0700
commit4a10f75f016af996bd15e90101f0d20e4d61e083 (patch)
treee4c97cccd9b3371cea11679ec0966c8c62977625 /src/main/java/org/traccar/session/ConnectionManager.java
parent708f04be5d9a25bd9d217127680a61f307cb8ef2 (diff)
downloadtrackermap-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.java6
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;
}