diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/database/ActiveDevice.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/database/ActiveDevice.java b/src/main/java/org/traccar/database/ActiveDevice.java index e3ece6ad9..c05d56ad2 100644 --- a/src/main/java/org/traccar/database/ActiveDevice.java +++ b/src/main/java/org/traccar/database/ActiveDevice.java @@ -29,12 +29,14 @@ public class ActiveDevice { private final Protocol protocol; private final Channel channel; private final SocketAddress remoteAddress; + private final boolean supportsLiveCommands; public ActiveDevice(long deviceId, Protocol protocol, Channel channel, SocketAddress remoteAddress) { this.deviceId = deviceId; this.protocol = protocol; this.channel = channel; this.remoteAddress = remoteAddress; + supportsLiveCommands = BasePipelineFactory.getHandler(channel.pipeline(), HttpRequestDecoder.class) == null; } public Channel getChannel() { @@ -46,7 +48,7 @@ public class ActiveDevice { } public boolean supportsLiveCommands() { - return BasePipelineFactory.getHandler(channel.pipeline(), HttpRequestDecoder.class) == null; + return supportsLiveCommands; } public void sendCommand(Command command) { |