Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/disconnect deserialize exception #5866

Merged
merged 4 commits into from
Jun 26, 2023

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Jun 26, 2023

  • Fix deserialize exception on disconnect message and invalid data exception, also on disconnect message it turns out.
  • Should not do much in terms of peer discovery, but helps cleanup metrics as they should be marked correctly now.

Changes

  • Add path to account for strange encoding.
  • Pass uncompressed data directly.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • No more such exception so far.

@@ -63,22 +64,22 @@ protected override void ChannelRead0(IChannelHandlerContext ctx, ZeroPacket inpu

try
{
int length = SnappyCodec.Uncompress(content.Array, content.ArrayOffset + content.ReaderIndex, content.ReadableBytes, output.Array, output.ArrayOffset);
int length = SnappyCodec.Uncompress(content.Array, content.ArrayOffset + content.ReaderIndex,
content.ReadableBytes, output.Array, output.ArrayOffset + output.WriterIndex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output.WriterIndex was missed previously? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea

@asdacap asdacap merged commit ff5f4a4 into master Jun 26, 2023
61 checks passed
@asdacap asdacap deleted the fix/disconnect-deserialize-exception branch June 26, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants