Repository navigation
Report TLS EOF and terminal errors consistently across backends - #650
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up #649 at the TLS adapter boundary. The shared reader handles a zero-byte EOF correctly, but TLS adapters can return -1 for terminal conditions while retaining a previous would-block status or reporting no native error.
Network.framework already has explicit EOF/error mappings and needs no change. Readiness and cancellation behavior are preserved.
Tests exercise real TLS handshakes and reads through the existing in-memory OpenSSL/Mbed TLS fixtures, including close_notify, terminal failures after would-block, and completion of readBytes from TLS buffers. A SecureTransport context with deterministic failing I/O callbacks covers the legacy adapter. No new test uses a network connection, sleep or timeout wait.
Validation: the new terminal-read assertions fail on master. All memory adapter tests pass with OpenSSL 1.1.1w and 3.6 (196 assertions each), Mbed TLS 3 and 4 (232 each), and SecureTransport (10). ThreadSanitizer runs pass for OpenSSL 3.6, Mbed TLS 4 and SecureTransport. Existing Network.framework tests pass (72 assertions), as do the shared read regressions (25). Production builds as strict C++11 with warnings as errors; only the legacy SecureTransport build suppresses its existing deprecation diagnostics. Network.framework builds without that suppression. Formatting and diff checks passed.