-
Notifications
You must be signed in to change notification settings - Fork 72
fix(tls): avoid infinite loop #499
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds EOF detection to the TLS stream read implementation by checking if read_tls returns 0 bytes read and breaking out of the read loop in that case.
Key Changes:
- Modified
read_implmethod to check for EOF condition (0 bytes returned fromread_tls)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I propose slightly breaking changes in this PR, as an emergency bug fix. As copilot said, the previously version might be attacked because of my buggy code. I have checked that the breaking change won't break the code of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
compio-tls/src/adapter.rs:75
- The
domain.to_string()creates an unnecessary allocation whendomainis already a&str. Thefutures_rustls::TlsConnector::connectlikely acceptsServerNameor similar that can be constructed directly from&strwithout cloning. Consider usingdomain.try_into()directly if the API supports it.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
George-Miao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Forgot to update the workspace manifest:( |
When
read_tlsreturnsOk(0), the connection might be disconnected. We should return immediately instead of spinning.