From 26523139a89e039f7cd34332e5da7cde9c75ee85 Mon Sep 17 00:00:00 2001 From: Danil Platonov Date: Sun, 25 Jan 2026 03:16:37 -0800 Subject: [PATCH 1/2] fix http stream not being closed fully --- src/machine/streams.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/machine/streams.rs b/src/machine/streams.rs index 0d88ca58..f966d91f 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -1537,6 +1537,7 @@ impl Stream { } #[cfg(feature = "http")] Stream::HttpWrite(mut http_stream) => { + http_stream.inner_mut().drop(); http_stream.drop_payload(); Ok(()) From 337d9c5583c4a58cc17b4ad84c834bb002173649 Mon Sep 17 00:00:00 2001 From: Danil Platonov Date: Mon, 26 Jan 2026 04:57:28 -0800 Subject: [PATCH 2/2] move drop to impl Drop --- src/machine/streams.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/machine/streams.rs b/src/machine/streams.rs index f966d91f..1169c94d 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -330,10 +330,7 @@ impl Write for HttpWriteStream { } #[cfg(feature = "http")] -impl HttpWriteStream { - // TODO why is this suddenly dead code and should it be used somewhere? - // Should this be impl Drop for HttpWriteStream? - #[allow(dead_code)] +impl Drop for HttpWriteStream { fn drop(&mut self) { let headers = unsafe { std::mem::ManuallyDrop::take(&mut self.headers) }; let buffer = unsafe { std::mem::ManuallyDrop::take(&mut self.buffer) }; @@ -1537,7 +1534,6 @@ impl Stream { } #[cfg(feature = "http")] Stream::HttpWrite(mut http_stream) => { - http_stream.inner_mut().drop(); http_stream.drop_payload(); Ok(())