From 45c35eca3e92806396b460081ed5c79ed33cf02a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Mon, 28 Mar 2022 21:04:46 +0200 Subject: [PATCH] Add close handling of http stream --- src/machine/streams.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/machine/streams.rs b/src/machine/streams.rs index a0dc83f5..072aa1f8 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -1050,6 +1050,14 @@ impl Stream { Stream::NamedTls(ref mut tls_stream) => { tls_stream.inner_mut().tls_stream.shutdown() } + Stream::NamedHttpClient(ref mut http_stream) => { + unsafe { + http_stream.set_tag(ArenaHeaderTag::Dropped); + std::ptr::drop_in_place(&mut http_stream.inner_mut().body_reader as *mut _); + } + + Ok(()) + } Stream::InputFile(mut file_stream) => { // close the stream by dropping the inner File. unsafe { -- 2.54.0