diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-10 13:40:37 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-10 13:40:37 +1300 |
commit | da7852b28d48f0c3a3a2e5d272fa89ea28817abf (patch) | |
tree | e48d35f9fd8f20ba8f59be124a2eb24b70d0446e /src/org | |
parent | ef1567a5eea6937d6d7e1bf6f9855c474ca57866 (diff) | |
download | trackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.tar.gz trackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.tar.bz2 trackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.zip |
Fix Tramigo frame decoder
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/TramigoFrameDecoder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TramigoFrameDecoder.java b/src/org/traccar/protocol/TramigoFrameDecoder.java index 5b3f41078..f6dde4298 100644 --- a/src/org/traccar/protocol/TramigoFrameDecoder.java +++ b/src/org/traccar/protocol/TramigoFrameDecoder.java @@ -44,10 +44,16 @@ public class TramigoFrameDecoder extends LengthFieldBasedFrameDecoder { int length = buf.readableBytes(); byte bytes[] = new byte[length]; buf.getBytes(buf.readerIndex(), bytes); - buf = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, bytes); + + ChannelBuffer result = (ChannelBuffer) super.decode( + ctx, channel, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, bytes)); + if (result != null) { + buf.skipBytes(result.readableBytes()); + } + return result; } - return decode(ctx, channel, buf); + return super.decode(ctx, channel, buf); } } |