From df53571ab09afb15888462dbbed2c3d58759c55a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 19 Jul 2017 01:30:38 +1200 Subject: Disable session cache for HTTP protocols --- src/org/traccar/BaseProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 54d2bf28f..7a393727b 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -17,6 +17,7 @@ package org.traccar; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.socket.DatagramChannel; +import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.traccar.helper.Log; import org.traccar.model.Device; import org.traccar.model.Position; @@ -105,7 +106,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } public DeviceSession getDeviceSession(Channel channel, SocketAddress remoteAddress, String... uniqueIds) { - if (Context.getConfig().getBoolean("decoder.ignoreSessionCache")) { + if (channel.getPipeline().get(HttpRequestDecoder.class) != null + || Context.getConfig().getBoolean("decoder.ignoreSessionCache")) { long deviceId = findDeviceId(remoteAddress, uniqueIds); if (deviceId != 0) { if (Context.getConnectionManager() != null) { -- cgit v1.2.3