Skip to content

Commit 9b68186

Browse files
sighphyreJohnTitor
authored andcommitted
chore: reduce down to minimal fix
1 parent a816f61 commit 9b68186

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

actix-http/src/h1/dispatcher.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ use tokio_util::codec::{Decoder as _, Encoder as _};
2020
use tracing::{error, trace};
2121

2222
use super::{
23-
Message, MessageType,
2423
codec::Codec,
2524
decoder::MAX_BUFFER_SIZE,
2625
payload::{Payload, PayloadSender, PayloadStatus},
2726
timer::TimerState,
27+
Message, MessageType,
2828
};
2929
use crate::{
30-
Error, Extensions, OnConnectData, Request, Response, StatusCode,
3130
body::{BodySize, BoxBody, MessageBody},
3231
config::ServiceConfig,
3332
error::{DispatchError, ParseError, PayloadError},
3433
service::HttpFlow,
34+
Error, Extensions, OnConnectData, Request, Response, StatusCode,
3535
};
3636

3737
const LW_BUFFER_SIZE: usize = 1024;
@@ -236,12 +236,16 @@ enum PollResponse {
236236
impl<T, S, B, X, U> Dispatcher<T, S, B, X, U>
237237
where
238238
T: AsyncRead + AsyncWrite + Unpin,
239+
239240
S: Service<Request>,
240241
S::Error: Into<Response<BoxBody>>,
241242
S::Response: Into<Response<B>>,
243+
242244
B: MessageBody,
245+
243246
X: Service<Request, Response = Request>,
244247
X::Error: Into<Response<BoxBody>>,
248+
245249
U: Service<(Request, Framed<T, Codec>), Response = ()>,
246250
U::Error: fmt::Display,
247251
{
@@ -287,12 +291,16 @@ where
287291
impl<T, S, B, X, U> InnerDispatcher<T, S, B, X, U>
288292
where
289293
T: AsyncRead + AsyncWrite + Unpin,
294+
290295
S: Service<Request>,
291296
S::Error: Into<Response<BoxBody>>,
292297
S::Response: Into<Response<B>>,
298+
293299
B: MessageBody,
300+
294301
X: Service<Request, Response = Request>,
295302
X::Error: Into<Response<BoxBody>>,
303+
296304
U: Service<(Request, Framed<T, Codec>), Response = ()>,
297305
U::Error: fmt::Display,
298306
{
@@ -654,10 +662,6 @@ where
654662
// to notify the dispatcher a new state is set and the outer loop
655663
// should be continue.
656664
Poll::Ready(Ok(res)) => {
657-
let this = self.as_mut().project();
658-
if let Some(mut payload) = this.payload.take() {
659-
payload.feed_eof();
660-
}
661665
let (res, body) = res.into().replace_body(());
662666
self.as_mut().send_response(res, body)
663667
}
@@ -1045,12 +1049,16 @@ where
10451049
impl<T, S, B, X, U> Future for Dispatcher<T, S, B, X, U>
10461050
where
10471051
T: AsyncRead + AsyncWrite + Unpin,
1052+
10481053
S: Service<Request>,
10491054
S::Error: Into<Response<BoxBody>>,
10501055
S::Response: Into<Response<B>>,
1056+
10511057
B: MessageBody,
1058+
10521059
X: Service<Request, Response = Request>,
10531060
X::Error: Into<Response<BoxBody>>,
1061+
10541062
U: Service<(Request, Framed<T, Codec>), Response = ()>,
10551063
U::Error: fmt::Display,
10561064
{

0 commit comments

Comments
 (0)