Closed levili-T closed 7 months ago
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
d065797
) 61.23% compared to head (144eda3
) 61.23%.
Files | Patch % | Lines |
---|---|---|
lib/src/utility/mqtt_byte_buffer.dart | 0.00% | 2 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Can you explain what you are trying to do here. it looks as though avibytes and availablebytes will have the same value, I'm not following this.
MqttHeader.fromByteBuffer(this); will move the postion, so after executing this function, availableBytes is the buffer length minus the mqtt fixed header length. _position = position; will reset the position to fromByteBuffer before moving the position. availableBytes becomes the length of the entire buffer, including the length of the mqtt fixed header. You can refer to the processing of MqttMessage.createFrom function to understand
------------------ 原始邮件 ------------------ 发件人: "Steve @.>; 发送时间: 2024年1月13日(星期六) 晚上6:44 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [shamblett/mqtt5_client] -- mqtt协议解析剩余长度判断不一致,导致解析异常connection 断连 (PR #81)
Can you explain what you are trying to do here. it looks as though avibytes and availablebytes will have the same value, I'm not following this.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
int get availableBytes => length - _position;
and
_position = position; // will cause availableBytes add mqtt fix header len
if (availableBytes < header.messageSize)
Yes I see, well spotted, this has been a tricky area in the past, it could probably do with a complete re write. Package re published at version 4.1.0.
MQTT protocol parsing remaining length judgment is inconsistent, resulting in parsing exception connection disconnection