You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "morphad (via GitHub)" <gi...@apache.org> on 2024/09/10 12:28:56 UTC
[I] cpp network module LengthPrefixCodec has a bug [ignite]
morphad opened a new issue, #11524:
URL: https://github.com/apache/ignite/issues/11524
when using ignite cpp thin client, we find a bug of LengthPrefixCodec::Decode function, in file modules/platforms/cpp/network/src/network/length_prefix_codec.cpp
```
DataBuffer LengthPrefixCodec::Decode(DataBuffer& data)
{
if (packet.IsValid() && packet.Get()->Length() == (PACKET_HEADER_SIZE + packetSize))
{
packetSize = -1;
packet.Get()->Length(0);
}
if (packetSize < 0)
{
Consume(data, PACKET_HEADER_SIZE);
if (packet.Get()->Length() < PACKET_HEADER_SIZE)
return DataBuffer();
packetSize = impl::binary::BinaryUtils::ReadInt32(*packet.Get(), 0);
}
Consume(data, PACKET_HEADER_SIZE + packetSize);
if (packet.Get()->Length() == (PACKET_HEADER_SIZE + packetSize))
return DataBuffer(packet, 0, PACKET_HEADER_SIZE + packetSize);
return DataBuffer();
}
```
1. a call with data length of 3, the packetSize reset to -1, and the packet length is 3
2. following call, will enter first if, and the packet length of 3 reset to -1
can be fix as :
```
DataBuffer LengthPrefixCodec::Decode(DataBuffer& data)
{
if (packet.IsValid() && packetSize != -1 && packet.Get()->Length() == (PACKET_HEADER_SIZE + packetSize))
{
packetSize = -1;
packet.Get()->Length(0);
}
```
--
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: notifications-unsubscribe@ignite.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] cpp network module LengthPrefixCodec has a bug [ignite]
Posted by "isapego (via GitHub)" <gi...@apache.org>.
isapego commented on issue #11524:
URL: https://github.com/apache/ignite/issues/11524#issuecomment-2579667210
The patch #11777 is merged.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] cpp network module LengthPrefixCodec has a bug [ignite]
Posted by "isapego (via GitHub)" <gi...@apache.org>.
isapego commented on issue #11524:
URL: https://github.com/apache/ignite/issues/11524#issuecomment-2454337357
Thanks for the bug report. I've created related Jira: https://issues.apache.org/jira/browse/IGNITE-23598. Sorry for the late replay.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] cpp network module LengthPrefixCodec has a bug [ignite]
Posted by "isapego (via GitHub)" <gi...@apache.org>.
isapego closed issue #11524: cpp network module LengthPrefixCodec has a bug
URL: https://github.com/apache/ignite/issues/11524
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org