From 1ca4f041bb452742f326985479fca9a02473649f Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 5 Apr 2021 15:53:09 +0200 Subject: [PATCH] http2: pass data through when decompression fails as is done for HTTP1 --- rust/src/http2/decompression.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/rust/src/http2/decompression.rs b/rust/src/http2/decompression.rs index 205b527a14..518a8e3201 100644 --- a/rust/src/http2/decompression.rs +++ b/rust/src/http2/decompression.rs @@ -172,10 +172,24 @@ impl HTTP2DecoderHalf { ) -> io::Result<&'a [u8]> { match self.decoder { HTTP2Decompresser::GZIP(ref mut gzip_decoder) => { - return http2_decompress(gzip_decoder, input, output); + let r = http2_decompress(gzip_decoder, input, output); + match r { + Err(_) => { + self.decoder = HTTP2Decompresser::UNASSIGNED; + } + _ => {} + } + return r; } HTTP2Decompresser::BROTLI(ref mut br_decoder) => { - return http2_decompress(br_decoder, input, output); + let r = http2_decompress(br_decoder, input, output); + match r { + Err(_) => { + self.decoder = HTTP2Decompresser::UNASSIGNED; + } + _ => {} + } + return r; } _ => {} } -- 2.47.2