diff --git a/src/stream.rs b/src/stream.rs index b316ed5..ae09308 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -18,6 +18,16 @@ pub enum Stream { Test(Box, Vec), } +impl Drop for Stream { + fn drop(&mut self) { + match self { + #[cfg(feature = "tls")] + Stream::Https(s) => { s.shutdown().ok(); }, + _ => (), + } + } +} + impl ::std::fmt::Debug for Stream { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::result::Result<(), ::std::fmt::Error> { write!(