You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/08/10 12:02:12 UTC

[plc4x] 02/05: - Made it possible to decode messages without length information

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit b8c044b4818f1a4a660f9d0751329da313521858
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Aug 10 13:58:56 2020 +0200

    - Made it possible to decode messages without length information
---
 .../apache/plc4x/java/spi/connection/GeneratedProtocolMessageCodec.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/GeneratedProtocolMessageCodec.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/GeneratedProtocolMessageCodec.java
index a130c24..5ea0001 100644
--- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/GeneratedProtocolMessageCodec.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/GeneratedProtocolMessageCodec.java
@@ -46,7 +46,7 @@ public class GeneratedProtocolMessageCodec<BASE_PACKET_CLASS extends Message> ex
     @Override
     protected int getPacketSize(ByteBuf byteBuf) {
         if (this.packetSizeEstimator == null) {
-            return -1;
+            return byteBuf.readableBytes();
         }
         return packetSizeEstimator.applyAsInt(byteBuf);
     }