fix(tls): avoid infinite loop#499
Conversation
There was a problem hiding this comment.
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.
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.
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.
|
Forgot to update the workspace manifest:( |
When
read_tlsreturnsOk(0), the connection might be disconnected. We should return immediately instead of spinning.