diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-03-07 22:59:12 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-03-07 22:59:12 -0600 |
commit | 00d3ddf7b5e335a5112a28a547c4c9ec2c3bd1d2 (patch) | |
tree | a02ecb75a8533194314d32c0c667520bff5e919d /src/main/java/org/traccar/BaseProtocol.java | |
parent | 8e1bc703227a875c20e453704d774ce5772f2621 (diff) | |
parent | 75b404db5c790bf37c05fabf1cbbd2027ad1db25 (diff) | |
download | trackermap-server-00d3ddf7b5e335a5112a28a547c4c9ec2c3bd1d2.tar.gz trackermap-server-00d3ddf7b5e335a5112a28a547c4c9ec2c3bd1d2.tar.bz2 trackermap-server-00d3ddf7b5e335a5112a28a547c4c9ec2c3bd1d2.zip |
Merge branch 'master' of https://github.com/traccar/traccar
Diffstat (limited to 'src/main/java/org/traccar/BaseProtocol.java')
-rw-r--r-- | src/main/java/org/traccar/BaseProtocol.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/BaseProtocol.java b/src/main/java/org/traccar/BaseProtocol.java index d19fc307e..ea302997c 100644 --- a/src/main/java/org/traccar/BaseProtocol.java +++ b/src/main/java/org/traccar/BaseProtocol.java @@ -23,8 +23,8 @@ import org.traccar.helper.DataConverter; import org.traccar.model.Command; import org.traccar.sms.SmsManager; -import javax.annotation.Nullable; -import javax.inject.Inject; +import jakarta.annotation.Nullable; +import jakarta.inject.Inject; import java.net.SocketAddress; import java.util.Arrays; import java.util.Collection; @@ -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)); |