aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/HuabaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-09 16:16:37 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-09 16:16:37 +1200
commit0e1c89d007b761a83c11dcb2ba378c4db02200ee (patch)
tree2589b42bf1e0cecd0fa1cc74df3b0adacd47c647 /src/org/traccar/protocol/HuabaoProtocolDecoder.java
parent5cf987a9e9cab3e9ec3d2a8acc335a85f2637df0 (diff)
downloadtrackermap-server-0e1c89d007b761a83c11dcb2ba378c4db02200ee.tar.gz
trackermap-server-0e1c89d007b761a83c11dcb2ba378c4db02200ee.tar.bz2
trackermap-server-0e1c89d007b761a83c11dcb2ba378c4db02200ee.zip
Mark reference counting to fix
Diffstat (limited to 'src/org/traccar/protocol/HuabaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/HuabaoProtocolDecoder.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/org/traccar/protocol/HuabaoProtocolDecoder.java
index c9868b21e..7546b75a8 100644
--- a/src/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -64,11 +64,12 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
private void sendGeneralResponse(
Channel channel, SocketAddress remoteAddress, ByteBuf id, int type, int index) {
if (channel != null) {
- ByteBuf response = Unpooled.buffer();
+ ByteBuf response = Unpooled.buffer(); // TODO ref count
response.writeShort(index);
response.writeShort(type);
response.writeByte(RESULT_SUCCESS);
- channel.writeAndFlush(new NetworkMessage(formatMessage(MSG_GENERAL_RESPONSE, id, response), remoteAddress));
+ channel.writeAndFlush(new NetworkMessage(
+ formatMessage(MSG_GENERAL_RESPONSE, id, response), remoteAddress));
}
}
@@ -118,7 +119,7 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
if (type == MSG_TERMINAL_REGISTER) {
if (channel != null) {
- ByteBuf response = Unpooled.buffer();
+ ByteBuf response = Unpooled.buffer(); // TODO ref count
response.writeShort(index);
response.writeByte(RESULT_SUCCESS);
response.writeBytes("authentication".getBytes(StandardCharsets.US_ASCII));