From: Adrián Arroyo Calle Date: Mon, 28 Mar 2022 19:04:46 +0000 (+0200) Subject: Add close handling of http stream X-Git-Tag: v0.9.1~87^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=45c35eca3e92806396b460081ed5c79ed33cf02a;p=scryer-prolog.git Add close handling of http stream --- 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 {