Skip to content

fix: strip already-read drained bytes in KtlsStream::into_raw - #83

Closed
ArniDagur wants to merge 1 commit into
rustls:mainfrom
ArniDagur:fix-into-raw-drained-offset
Closed

ArniDagur wants to merge 1 commit into
rustls:mainfrom
ArniDagur:fix-into-raw-drained-offset

Conversation

@ArniDagur

Copy link
Copy Markdown
Contributor

KtlsStream::into_raw ignored drain_index and returned the entire original Vec<u8>, duplicating bytes already returned by earlier poll_read calls.

Drains ..drain_index before returning the buffer and adds a unit test.

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.34%. Comparing base (d9d1381) to head (420ec95).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
ktls/src/ktls_stream.rs 50.00% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
- Coverage   87.69%   87.34%   -0.36%     
==========================================
  Files           6        6              
  Lines         943     1067     +124     
==========================================
+ Hits          827      932     +105     
- Misses        116      135      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`KtlsStream::into_raw` discarded `drain_index` and returned the entire
original `Vec<u8>`, including bytes already returned by earlier
`poll_read` calls.
@ArniDagur
ArniDagur force-pushed the fix-into-raw-drained-offset branch from 420ec95 to 12dc977 Compare December 3, 2026 16:42
@ArniDagur

Copy link
Copy Markdown
Contributor Author

Superseded by #84.

@ArniDagur ArniDagur closed this Dec 3, 2026
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.

1 participant