aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CastelProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-10 10:55:06 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-10 10:55:06 +1200
commit1dc1e06cfd4b7b23775984a254723b2d06b4f1dd (patch)
tree6dd89b120a7400ff3f08b2cb213cadc27112d0e7 /src/org/traccar/protocol/CastelProtocolDecoder.java
parent58a222ba3d546dc2366586f2c904e70680a394bd (diff)
downloadtrackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.tar.gz
trackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.tar.bz2
trackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.zip
Handle buffers reference count
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index 1be66b17d..344ca2df4 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -205,6 +205,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
response.writeShort(type);
if (content != null) {
response.writeBytes(content);
+ content.release();
}
response.writeShortLE(
Checksum.crc16(Checksum.CRC16_X25, response.nioBuffer(0, response.writerIndex())));
@@ -296,7 +297,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
|| type == MSG_SC_ALARM || type == MSG_SC_CURRENT_LOCATION || type == MSG_SC_FUEL) {
if (type == MSG_SC_LOGIN) {
- ByteBuf response = Unpooled.buffer(10); // TODO ref count
+ ByteBuf response = Unpooled.buffer(10);
response.writeIntLE(0xFFFFFFFF);
response.writeShortLE(0);
response.writeIntLE((int) (System.currentTimeMillis() / 1000));