-
Notifications
You must be signed in to change notification settings - Fork 156
fix: Replace qpack::Data with trait
#3013
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5cf02bf
fix: Replace `qpack::Data` with trait
larseggert aac9cc4
fix: address CoPilot review comments for buffer management
larseggert 3bb91a1
Update neqo-qpack/src/qpack_send_buf.rs
larseggert fd6390f
Update neqo-qpack/src/qpack_send_buf.rs
larseggert 8a0eaea
Update neqo-common/src/codec.rs
larseggert 171089b
Update neqo-qpack/src/decoder.rs
larseggert 89059cc
Update neqo-common/src/codec.rs
larseggert 23a53a7
Merge branch 'main' into fix-2754
larseggert b4ddcef
Cleanup
larseggert f23f554
skip
larseggert 00d9c60
Rename
larseggert 47aebcc
Merge branch 'main' into fix-2754
larseggert 366fd52
Fix merge
larseggert b35e4b4
Merge branch 'main' into fix-2754
larseggert ff7db6b
Fixes
larseggert 138e652
Fixes
larseggert d1d6b82
Merge branch 'fix-2754' of github.com:larseggert/neqo into fix-2754
larseggert bc6846f
Merge branch 'main' into fix-2754
larseggert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -409,6 +409,34 @@ impl Encoder<Vec<u8>> { | |
| Self::default() | ||
| } | ||
|
|
||
| /// Create a new [`Encoder`] that takes ownership of the provided [`Vec<u8>`]. | ||
| /// | ||
| /// The encoder will treat any existing data in the vector as "pre-existing" | ||
| /// and will append new encoded data after it. The start position is set to | ||
| /// the current length of the vector, so only newly encoded data will be | ||
| /// considered part of the encoder's content. | ||
| /// | ||
| /// This is useful when you want to preserve existing buffer contents while | ||
| /// continuing to encode additional data. | ||
| #[must_use] | ||
| pub fn new_with_vec(buf: Vec<u8>) -> Self { | ||
| let start = buf.len(); | ||
| Self { buf, start } | ||
| } | ||
|
martinthomson marked this conversation as resolved.
Outdated
|
||
|
|
||
| /// Drain the first `n` bytes from the encoder buffer, returning an iterator | ||
| /// over the drained elements. This follows standard Rust drain semantics. | ||
| /// | ||
| /// # Panics | ||
| /// | ||
| /// Panics if `n` is greater than the current length of the encoder. | ||
| pub fn drain(&mut self, n: usize) -> std::vec::Drain<'_, u8> { | ||
| assert!(n <= self.len(), "Cannot drain beyond buffer length"); | ||
| let drain_iter = self.buf.drain(self.start..self.start + n); | ||
| self.start = self.start.saturating_sub(n); | ||
| drain_iter | ||
| } | ||
|
larseggert marked this conversation as resolved.
larseggert marked this conversation as resolved.
Comment on lines
+428
to
+437
|
||
|
|
||
| /// Static helper function for previewing the results of encoding without doing it. | ||
| /// | ||
| /// # Panics | ||
|
|
||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.