aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/EgtsProtocolDecoder.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/EgtsProtocolDecoder.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/EgtsProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/EgtsProtocolDecoder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/EgtsProtocolDecoder.java b/src/org/traccar/protocol/EgtsProtocolDecoder.java
index df02b8f7f..5b1b49370 100644
--- a/src/org/traccar/protocol/EgtsProtocolDecoder.java
+++ b/src/org/traccar/protocol/EgtsProtocolDecoder.java
@@ -75,12 +75,12 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder {
Channel channel, int packetType, int index, int serviceType, int type, ByteBuf content) {
if (channel != null) {
- ByteBuf data = Unpooled.buffer(0);
+ ByteBuf data = Unpooled.buffer(); // TODO ref count
data.writeByte(type);
data.writeShortLE(content.readableBytes());
data.writeBytes(content);
- ByteBuf record = Unpooled.buffer(0);
+ ByteBuf record = Unpooled.buffer(); // TODO ref count
if (packetType == PT_RESPONSE) {
record.writeShortLE(index);
record.writeByte(0); // success
@@ -93,7 +93,7 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder {
record.writeBytes(data);
int recordChecksum = Checksum.crc16(Checksum.CRC16_CCITT_FALSE, record.nioBuffer());
- ByteBuf response = Unpooled.buffer(0);
+ ByteBuf response = Unpooled.buffer();
response.writeByte(1); // protocol version
response.writeByte(0); // security key id
response.writeByte(0); // flags
@@ -150,7 +150,7 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
}
- ByteBuf response = Unpooled.buffer(0);
+ ByteBuf response = Unpooled.buffer(); // TODO ref count
response.writeShortLE(recordIndex);
response.writeByte(0); // success
sendResponse(channel, PT_RESPONSE, index, serviceType, MSG_RECORD_RESPONSE, response);
@@ -189,7 +189,7 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder {
channel, remoteAddress, buf.readSlice(15).toString(StandardCharsets.US_ASCII).trim());
}
- response = Unpooled.buffer(0);
+ response = Unpooled.buffer(); // TODO ref count
response.writeByte(0); // success
sendResponse(channel, PT_APPDATA, 0, serviceType, MSG_RESULT_CODE, response);