aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-23 00:58:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-23 00:58:59 +1200
commite218ed3cd4fa3c1630ba15faacc23774c40543d0 (patch)
tree9e214afeb310cf92956ce2cfb01d7b729d0dc6e0 /src
parentc92f37404893cce14a25379bcd84bb081e94f1b8 (diff)
downloadtrackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.tar.gz
trackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.tar.bz2
trackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.zip
Return http error if unknown
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index da502ca65..12192c457 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -64,6 +64,9 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
case "deviceid":
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, value);
if (deviceSession == null) {
+ if (channel != null) {
+ channel.write(new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST));
+ }
return null;
}
position.setDeviceId(deviceSession.getDeviceId());