@@ -20,18 +20,18 @@ use tokio_util::codec::{Decoder as _, Encoder as _};
20
20
use tracing:: { error, trace} ;
21
21
22
22
use super :: {
23
- Message , MessageType ,
24
23
codec:: Codec ,
25
24
decoder:: MAX_BUFFER_SIZE ,
26
25
payload:: { Payload , PayloadSender , PayloadStatus } ,
27
26
timer:: TimerState ,
27
+ Message , MessageType ,
28
28
} ;
29
29
use crate :: {
30
- Error , Extensions , OnConnectData , Request , Response , StatusCode ,
31
30
body:: { BodySize , BoxBody , MessageBody } ,
32
31
config:: ServiceConfig ,
33
32
error:: { DispatchError , ParseError , PayloadError } ,
34
33
service:: HttpFlow ,
34
+ Error , Extensions , OnConnectData , Request , Response , StatusCode ,
35
35
} ;
36
36
37
37
const LW_BUFFER_SIZE : usize = 1024 ;
@@ -236,12 +236,16 @@ enum PollResponse {
236
236
impl < T , S , B , X , U > Dispatcher < T , S , B , X , U >
237
237
where
238
238
T : AsyncRead + AsyncWrite + Unpin ,
239
+
239
240
S : Service < Request > ,
240
241
S :: Error : Into < Response < BoxBody > > ,
241
242
S :: Response : Into < Response < B > > ,
243
+
242
244
B : MessageBody ,
245
+
243
246
X : Service < Request , Response = Request > ,
244
247
X :: Error : Into < Response < BoxBody > > ,
248
+
245
249
U : Service < ( Request , Framed < T , Codec > ) , Response = ( ) > ,
246
250
U :: Error : fmt:: Display ,
247
251
{
@@ -287,12 +291,16 @@ where
287
291
impl < T , S , B , X , U > InnerDispatcher < T , S , B , X , U >
288
292
where
289
293
T : AsyncRead + AsyncWrite + Unpin ,
294
+
290
295
S : Service < Request > ,
291
296
S :: Error : Into < Response < BoxBody > > ,
292
297
S :: Response : Into < Response < B > > ,
298
+
293
299
B : MessageBody ,
300
+
294
301
X : Service < Request , Response = Request > ,
295
302
X :: Error : Into < Response < BoxBody > > ,
303
+
296
304
U : Service < ( Request , Framed < T , Codec > ) , Response = ( ) > ,
297
305
U :: Error : fmt:: Display ,
298
306
{
@@ -654,10 +662,6 @@ where
654
662
// to notify the dispatcher a new state is set and the outer loop
655
663
// should be continue.
656
664
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
- }
661
665
let ( res, body) = res. into ( ) . replace_body ( ( ) ) ;
662
666
self . as_mut ( ) . send_response ( res, body)
663
667
}
@@ -1045,12 +1049,16 @@ where
1045
1049
impl < T , S , B , X , U > Future for Dispatcher < T , S , B , X , U >
1046
1050
where
1047
1051
T : AsyncRead + AsyncWrite + Unpin ,
1052
+
1048
1053
S : Service < Request > ,
1049
1054
S :: Error : Into < Response < BoxBody > > ,
1050
1055
S :: Response : Into < Response < B > > ,
1056
+
1051
1057
B : MessageBody ,
1058
+
1052
1059
X : Service < Request , Response = Request > ,
1053
1060
X :: Error : Into < Response < BoxBody > > ,
1061
+
1054
1062
U : Service < ( Request , Framed < T , Codec > ) , Response = ( ) > ,
1055
1063
U :: Error : fmt:: Display ,
1056
1064
{
0 commit comments