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 kad double read #282

Merged
merged 1 commit into from
Nov 29, 2024
Merged

fix kad double read #282

merged 1 commit into from
Nov 29, 2024

Conversation

turuslan
Copy link
Contributor

  • read was called twice, from onMessageRead and onMessageWritten
  • simplify and deduplicate read/write request/response
    • server (SessionHost) reads request, writes response, repeats.
    • client (ResponseHandler) writes request, reads response, closes stream.
      • ADD_PROVIDER writes request, (no response), closes stream.
  • read uses MessageReadWriterUvarint, but write doesn't use that because Message::serialize adds length prefix.

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from igor-egorov November 29, 2024 05:41
@turuslan turuslan mentioned this pull request Nov 29, 2024
@turuslan turuslan merged commit a52146d into master Nov 29, 2024
4 checks passed
@turuslan turuslan deleted the fix/kad-session branch November 29, 2024 06:10
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.

2 participants