Add close handling of http stream

This commit is contained in:
Adrián Arroyo Calle
2022-03-28 21:04:46 +02:00
parent bb2a8c9090
commit 45c35eca3e

View File

@@ -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 {