Skip to content

Fix TLS blocking issue when buffer is doubled [dev]#1743

Merged
badrishc merged 7 commits into
devfrom
badrishc/fix-doubling-tls
Apr 28, 2026
Merged

Fix TLS blocking issue when buffer is doubled [dev]#1743
badrishc merged 7 commits into
devfrom
badrishc/fix-doubling-tls

Conversation

@badrishc

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 28, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a TLS read-path edge case in NetworkHandler where doubling the transport receive buffer during an async TLS read could fail to trigger the follow-up read needed to drain remaining decrypted bytes, potentially leaving data stuck until more network bytes arrive.

Changes:

  • Add an initialRetry flag to TLS async read helpers to carry “buffer just doubled; attempt another read” state across async continuations.
  • Propagate the retry state when chaining from the Task<int>-based completion handler into the general async TLS reader loop.
  • Update call sites after authentication and in the rare async branch of Read() to pass the new parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/common/Networking/NetworkHandler.cs Outdated
Comment thread libs/common/Networking/NetworkHandler.cs Outdated
@badrishc badrishc marked this pull request as draft April 28, 2026 17:04
@badrishc badrishc marked this pull request as ready for review April 28, 2026 21:52
@badrishc badrishc changed the title Fix TLS issue when buffer is doubled [dev] Fix TLS blocking issue when buffer is doubled [dev] Apr 28, 2026
@badrishc badrishc merged commit 522b89b into dev Apr 28, 2026
44 of 45 checks passed
@badrishc badrishc deleted the badrishc/fix-doubling-tls branch April 28, 2026 23:50
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.

3 participants