aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/At2000FrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-11 12:34:38 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-02-11 12:34:38 +1300
commitb70eddfcda8262ec4bf76213d414ef55950478d0 (patch)
treec302957f3999fcf571c93a62778defcd403b5851 /src/org/traccar/protocol/At2000FrameDecoder.java
parentc8fa36318702acc9ff54d3811e1f32c1035e85f3 (diff)
downloadtrackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.gz
trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.bz2
trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.zip
Fix some code issues
Diffstat (limited to 'src/org/traccar/protocol/At2000FrameDecoder.java')
-rw-r--r--src/org/traccar/protocol/At2000FrameDecoder.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/At2000FrameDecoder.java b/src/org/traccar/protocol/At2000FrameDecoder.java
index f87dc3885..af257d0fb 100644
--- a/src/org/traccar/protocol/At2000FrameDecoder.java
+++ b/src/org/traccar/protocol/At2000FrameDecoder.java
@@ -65,12 +65,11 @@ public class At2000FrameDecoder extends FrameDecoder {
length = (length / BLOCK_LENGTH + 1) * BLOCK_LENGTH;
}
- if (buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0) {
- if (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes) {
- sendResponse(channel);
- currentBuffer = buf;
- acknowledgedBytes = buf.readableBytes();
- }
+ if ((buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0)
+ && (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes)) {
+ sendResponse(channel);
+ currentBuffer = buf;
+ acknowledgedBytes = buf.readableBytes();
}
if (buf.readableBytes() >= length) {