We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db1c1d7 commit 4398afeCopy full SHA for 4398afe
src/server/encode.rs
@@ -257,7 +257,8 @@ impl Encoder {
257
// Calculate the max char count encoding the `len_prefix` statement
258
// as hex would take. This is done by rounding up `log16(amt)`.
259
let hex_len = (amt as f64).log(16.0).ceil() as usize;
260
- let buf_upper = buf_len.checked_sub(hex_len + 4).unwrap_or(0);
+ let crlf_len = 2 * 2;
261
+ let buf_upper = buf_len.checked_sub(hex_len + crlf_len).unwrap_or(0);
262
let amt = amt.min(buf_upper);
263
let len_prefix = format!("{:X}", amt).into_bytes();
264
0 commit comments