Misleading documentation for Builder::max_frame_length. #4340
Labels
A-tokio
Area: The main tokio crate
A-tokio-util
Area: The tokio-util crate
C-bug
Category: This is a bug.
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-help-wanted
Call for participation: Help is requested to fix this issue.
M-codec
Module: tokio-util/codec
Version
tokio-util current master (78e0f0b42a4f7a50f3986f576703e5a3cb473b79)
Platform
Linux ubuntu 5.11.0-1023-raspi #25-Ubuntu SMP PREEMPT Fri Nov 19 07:45:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
Description
The documentation of max_frame_length has a misleading example.
In the example it states the default value for frame length 8MB, this is correct (see: source). Then the example sets the value to 1024*8. Since
max_frame_length
is just a setter source the frame length is now 8KB.I inferred from this that the frame length is set in KB. I would suggest adjusting the example to set a value of 8 * 1024 * 1024 and mentioning it is the size in bytes.
I would be happy to pull request such a change, let me know.
The text was updated successfully, but these errors were encountered: