Add close handling of http stream
This commit is contained in:
@@ -1050,6 +1050,14 @@ impl Stream {
|
|||||||
Stream::NamedTls(ref mut tls_stream) => {
|
Stream::NamedTls(ref mut tls_stream) => {
|
||||||
tls_stream.inner_mut().tls_stream.shutdown()
|
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) => {
|
Stream::InputFile(mut file_stream) => {
|
||||||
// close the stream by dropping the inner File.
|
// close the stream by dropping the inner File.
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|||||||
Reference in New Issue
Block a user