diff options
author | Anton Tananaev <anton@traccar.org> | 2022-12-11 09:10:11 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-12-11 09:10:11 -0800 |
commit | 867e800009bf361c3da9306bc5a9e3f1fab43869 (patch) | |
tree | f41a9d0efe615b8e280b0d28904fcdb0764b9d68 /src/main/java/org | |
parent | 4b9ff1bd206adb826262acd4e3daf5c962518d7c (diff) | |
download | trackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.tar.gz trackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.tar.bz2 trackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.zip |
Improve T55 IP identification
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/T55ProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java index 90382439e..51f06a801 100644 --- a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java @@ -379,11 +379,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { } deviceSession = getDeviceSession(channel, remoteAddress, id); sentence = sentence.substring(index); - } else if (remoteAddress instanceof InetSocketAddress) { - String host = ((InetSocketAddress) remoteAddress).getHostString(); - deviceSession = getDeviceSession(channel, remoteAddress, host); } else { deviceSession = getDeviceSession(channel, remoteAddress); + if (deviceSession == null && remoteAddress instanceof InetSocketAddress) { + String host = ((InetSocketAddress) remoteAddress).getHostString(); + deviceSession = getDeviceSession(channel, remoteAddress, host); + } } if (sentence.startsWith("$PGID")) { |