From fcba638543caa06f7e87fc7862047b29170ece22 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 23 Jul 2020 20:43:41 -0700 Subject: Fix HTTP commands --- src/main/java/org/traccar/database/ActiveDevice.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3