From 9b6818694699255697f5c5f80f3ea612b76da2f1 Mon Sep 17 00:00:00 2001 From: Simon Hornby Date: Tue, 5 Aug 2025 13:47:23 +0200 Subject: [PATCH] chore: reduce down to minimal fix --- actix-http/src/h1/dispatcher.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 86e4d2c76..ed8fcc91c 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -20,18 +20,18 @@ use tokio_util::codec::{Decoder as _, Encoder as _}; use tracing::{error, trace}; use super::{ - Message, MessageType, codec::Codec, decoder::MAX_BUFFER_SIZE, payload::{Payload, PayloadSender, PayloadStatus}, timer::TimerState, + Message, MessageType, }; use crate::{ - Error, Extensions, OnConnectData, Request, Response, StatusCode, body::{BodySize, BoxBody, MessageBody}, config::ServiceConfig, error::{DispatchError, ParseError, PayloadError}, service::HttpFlow, + Error, Extensions, OnConnectData, Request, Response, StatusCode, }; const LW_BUFFER_SIZE: usize = 1024; @@ -236,12 +236,16 @@ enum PollResponse { impl Dispatcher where T: AsyncRead + AsyncWrite + Unpin, + S: Service, S::Error: Into>, S::Response: Into>, + B: MessageBody, + X: Service, X::Error: Into>, + U: Service<(Request, Framed), Response = ()>, U::Error: fmt::Display, { @@ -287,12 +291,16 @@ where impl InnerDispatcher where T: AsyncRead + AsyncWrite + Unpin, + S: Service, S::Error: Into>, S::Response: Into>, + B: MessageBody, + X: Service, X::Error: Into>, + U: Service<(Request, Framed), Response = ()>, U::Error: fmt::Display, { @@ -654,10 +662,6 @@ where // to notify the dispatcher a new state is set and the outer loop // should be continue. Poll::Ready(Ok(res)) => { - let this = self.as_mut().project(); - if let Some(mut payload) = this.payload.take() { - payload.feed_eof(); - } let (res, body) = res.into().replace_body(()); self.as_mut().send_response(res, body) } @@ -1045,12 +1049,16 @@ where impl Future for Dispatcher where T: AsyncRead + AsyncWrite + Unpin, + S: Service, S::Error: Into>, S::Response: Into>, + B: MessageBody, + X: Service, X::Error: Into>, + U: Service<(Request, Framed), Response = ()>, U::Error: fmt::Display, {