From 333911a4b8d16b17357944a2b8af657a66f165af Mon Sep 17 00:00:00 2001 From: Justin Karneges Date: Thu, 18 Jun 2026 09:13:24 -0700 Subject: [PATCH] connmgr: remove unused overflow feature in server responses --- src/connmgr/connection.rs | 19 +++---------------- src/core/http1/server.rs | 4 ++-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/connmgr/connection.rs b/src/connmgr/connection.rs index 3283375d..be272180 100644 --- a/src/connmgr/connection.rs +++ b/src/connmgr/connection.rs @@ -3657,14 +3657,10 @@ where }; // First call can't fail - let (size, overflowed) = prepare_body + let size = prepare_body .prepare(rdata.body, true) .expect("infallible prepare call failed"); - if overflowed > 0 { - debug!("server-conn {}: overflowing {} bytes", id, overflowed); - } - // We confirmed above that the data will fit in the buffer assert!(size == rdata.body.len()); @@ -3780,14 +3776,10 @@ where }; // First call can't fail - let (size, overflowed) = prepare_body + let size = prepare_body .prepare(rdata.body, !rdata.more) .expect("infallible prepare call failed"); - if overflowed > 0 { - debug!("server-conn {}: overflowing {} bytes", id, overflowed); - } - // We confirmed above that the data will fit in the buffer assert!(size == rdata.body.len()); @@ -3930,12 +3922,7 @@ where match &zresp.get().ptype { zhttppacket::ResponsePacket::Data(rdata) => { - let (size, overflowed) = - prepare_body.prepare(rdata.body, !rdata.more)?; - - if overflowed > 0 { - debug!("server-conn {}: overflowing {} bytes", id, overflowed); - } + let size = prepare_body.prepare(rdata.body, !rdata.more)?; if size < rdata.body.len() { return Err(Error::BufferExceeded); diff --git a/src/core/http1/server.rs b/src/core/http1/server.rs index 17aae4c0..2ceb86bd 100644 --- a/src/core/http1/server.rs +++ b/src/core/http1/server.rs @@ -564,7 +564,7 @@ pub struct ResponsePrepareBody<'a, 'b, R: AsyncRead, W: AsyncWrite> { impl ResponsePrepareBody<'_, '_, R, W> { // Only returns an error on invalid input - pub fn prepare(&mut self, src: &[u8], end: bool) -> Result<(usize, usize), Error> { + pub fn prepare(&mut self, src: &[u8], end: bool) -> Result { let state = self.state.borrow(); let state = state.as_ref().unwrap(); @@ -589,7 +589,7 @@ impl ResponsePrepareBody<'_, '_, R, W> { state.end.set(true); } - Ok((size, 0)) + Ok(size) } }