aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-09 06:37:34 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-09 06:37:34 -0700
commit92e90931cd806d4b2f53ff946a19b46595f856e9 (patch)
treeb35b805dc4a21480eed7ed828f5422a925babb87 /src/main/java
parent8790fed8864f9ce41fe219f8a757cc9dedec272d (diff)
downloadtrackermap-server-92e90931cd806d4b2f53ff946a19b46595f856e9.tar.gz
trackermap-server-92e90931cd806d4b2f53ff946a19b46595f856e9.tar.bz2
trackermap-server-92e90931cd806d4b2f53ff946a19b46595f856e9.zip
Support new line in text commands
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/BaseProtocol.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/BaseProtocol.java b/src/main/java/org/traccar/BaseProtocol.java
index d19fc307e..1948becc0 100644
--- a/src/main/java/org/traccar/BaseProtocol.java
+++ b/src/main/java/org/traccar/BaseProtocol.java
@@ -105,7 +105,8 @@ public abstract class BaseProtocol implements Protocol {
} else if (command.getType().equals(Command.TYPE_CUSTOM)) {
String data = command.getString(Command.KEY_DATA);
if (BasePipelineFactory.getHandler(channel.pipeline(), StringEncoder.class) != null) {
- channel.writeAndFlush(new NetworkMessage(data, remoteAddress));
+ channel.writeAndFlush(new NetworkMessage(
+ data.replace("\\r", "\r").replace("\\n", "\n"), remoteAddress));
} else {
ByteBuf buf = Unpooled.wrappedBuffer(DataConverter.parseHex(data));
channel.writeAndFlush(new NetworkMessage(buf, remoteAddress));