From 04035947b221aa99e5f56679a05f3fe91eef2f8c Mon Sep 17 00:00:00 2001 From: caiyuanhao Date: Wed, 15 Dec 2021 21:45:17 +0800 Subject: [PATCH] Not to consume buf in the decode_string Decoding error when processing continuation frames --- src/hpack/decoder.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hpack/decoder.rs b/src/hpack/decoder.rs index e4b34d1f..53c17543 100644 --- a/src/hpack/decoder.rs +++ b/src/hpack/decoder.rs @@ -319,7 +319,9 @@ impl Decoder { return ret; } - Ok(take(buf, len)) + let v = buf.chunk().copy_to_bytes(len); + buf.advance(len); + Ok(v) } }