aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-01-11 17:19:53 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-01-11 17:19:53 +1300
commit6b013eebc495d417d666a17b547762961acd6906 (patch)
treed67b3e4a18eea1642c0a979408d83d8ff03fda59
parenta52e44a9b102af054a281c7b5ee471e2a38a4753 (diff)
downloadtrackermap-server-6b013eebc495d417d666a17b547762961acd6906.tar.gz
trackermap-server-6b013eebc495d417d666a17b547762961acd6906.tar.bz2
trackermap-server-6b013eebc495d417d666a17b547762961acd6906.zip
Remove TAIP response
-rw-r--r--src/org/traccar/ServerManager.java4
-rw-r--r--src/org/traccar/protocol/SyrusProtocolDecoder.java7
-rw-r--r--test/org/traccar/protocol/SyrusProtocolDecoderTest.java2
3 files changed, 8 insertions, 5 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 44861582b..cd8a670ce 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -665,7 +665,7 @@ public class ServerManager {
new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("stringEncoder", new StringEncoder());
- pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this));
+ pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, true));
}
});
}
@@ -1025,7 +1025,7 @@ public class ServerManager {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this));
+ pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, false));
}
});
}
diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java
index b20e16bcb..e64544307 100644
--- a/src/org/traccar/protocol/SyrusProtocolDecoder.java
+++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java
@@ -29,9 +29,12 @@ import org.traccar.model.ExtendedInfoFormatter;
import org.traccar.model.Position;
public class SyrusProtocolDecoder extends BaseProtocolDecoder {
+
+ boolean sendResponse;
- public SyrusProtocolDecoder(ServerManager serverManager) {
+ public SyrusProtocolDecoder(ServerManager serverManager, boolean sendResponse) {
super(serverManager);
+ this.sendResponse = sendResponse;
}
private static final Pattern pattern = Pattern.compile(
@@ -112,7 +115,7 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder {
}
// Send response
- if (channel != null) {
+ if (sendResponse && channel != null) {
channel.write(id);
}
}
diff --git a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java
index 35d79d587..027d45acd 100644
--- a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java
@@ -9,7 +9,7 @@ public class SyrusProtocolDecoderTest {
@Test
public void testDecode() throws Exception {
- SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(null);
+ SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(null, false);
decoder.setDataManager(new TestDataManager());
verify(decoder.decode(null, null,