mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-17 00:00:11 +02:00
The Builder::new, new_codec, and new_read doc examples combined length_adjustment(0) with num_skip(0). This leaves the length header bytes in the buffer without accounting for them, so decoding returns a frame that includes the raw header at the front and is short at the back, corrupting the following frame. Drop num_skip(0) so the default (skip the header) behavior applies, and turn all three examples into executable doctests that perform a real encode/decode round-trip and assert on the payload, so this class of bug is caught automatically going forward. Fixes: #8348
tokio-util
Utilities for working with Tokio.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.