aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tk102ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Tk102ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tk102ProtocolDecoder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java
index 71e103e15..c3ba6d303 100644
--- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java
@@ -68,6 +68,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder {
response.writeBytes(dataSequence);
response.writeByte(content.readableBytes());
response.writeBytes(content);
+ content.release();
response.writeByte(']');
channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress()));
}
@@ -96,7 +97,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder {
}
if (getDeviceSession(channel, remoteAddress, id) != null) {
- ByteBuf response = Unpooled.buffer(); // TODO ref count
+ ByteBuf response = Unpooled.buffer();
response.writeByte(MODE_GPRS);
response.writeBytes(data);
sendResponse(channel, MSG_LOGIN_RESPONSE, dataSequence, response);
@@ -104,7 +105,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_HEARTBEAT_REQUEST) {
- sendResponse(channel, MSG_HEARTBEAT_RESPONSE, dataSequence, buf.readSlice(length));
+ sendResponse(channel, MSG_HEARTBEAT_RESPONSE, dataSequence, buf.readRetainedSlice(length));
} else {