ivandasch commented on a change in pull request #252:
URL: https://github.com/apache/ignite-3/pull/252#discussion_r680799363



##########
File path: 
modules/client-common/src/main/java/org/apache/ignite/client/proto/ClientMessageDecoder.java
##########
@@ -78,13 +73,10 @@ private boolean readMagic(ByteBuf byteBuf) {
         if (byteBuf.readableBytes() < MAGIC_BYTES.length)
             return false;
 
-        assert data.length == MAGIC_BYTES.length;
-
-        byteBuf.readBytes(data, 0, MAGIC_BYTES.length);
+        var data = new byte[MAGIC_BYTES.length];

Review comment:
       Seems that logic with `magicFailed` and `magicDecoded` works only one 
time. And seemd that it is not needed at all
   Just add 
   ```
    if (byteBuff.readableBytes() < MAGIC_BYTES.length) {
               return false
    }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to