aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.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/Gt06ProtocolDecoder.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/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index cc37d5602..22391c750 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -189,7 +189,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
private void sendPhotoRequest(Channel channel, int pictureId) {
ByteBuf photo = photos.get(pictureId);
- ByteBuf content = Unpooled.buffer();
+ ByteBuf content = Unpooled.buffer(); // TODO ref count
content.writeInt(pictureId);
content.writeInt(photo.writerIndex());
content.writeShort(Math.min(photo.writableBytes(), 1024));
@@ -437,7 +437,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_ADDRESS_REQUEST) {
String response = "NA&&NA&&0##";
- ByteBuf content = Unpooled.buffer();
+ ByteBuf content = Unpooled.buffer(); // TODO ref count
content.writeByte(response.length());
content.writeInt(0);
content.writeBytes(response.getBytes(StandardCharsets.US_ASCII));
@@ -446,7 +446,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_TIME_REQUEST) {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- ByteBuf content = Unpooled.buffer();
+ ByteBuf content = Unpooled.buffer(); // TODO ref count
content.writeByte(calendar.get(Calendar.YEAR) - 2000);
content.writeByte(calendar.get(Calendar.MONTH) + 1);
content.writeByte(calendar.get(Calendar.DAY_OF_MONTH));
@@ -484,7 +484,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // photo source
buf.readUnsignedByte(); // picture format
- ByteBuf photo = Unpooled.buffer(buf.readInt());
+ ByteBuf photo = Unpooled.buffer(buf.readInt()); // TODO release photo
int pictureId = buf.readInt();
photos.put(pictureId, photo);
sendPhotoRequest(channel, pictureId);