3
3
use std:: str:: FromStr ;
4
4
5
5
use async_dup:: { Arc , Mutex } ;
6
- use async_std :: io:: { BufReader , Read , Write } ;
7
- use async_std :: { prelude:: * , task } ;
6
+ use futures_lite :: io:: { AsyncRead as Read , AsyncWrite as Write , BufReader } ;
7
+ use futures_lite :: prelude:: * ;
8
8
use http_types:: content:: ContentLength ;
9
9
use http_types:: headers:: { EXPECT , TRANSFER_ENCODING } ;
10
10
use http_types:: { ensure, ensure_eq, format_err} ;
@@ -103,7 +103,7 @@ where
103
103
let ( body_read_sender, body_read_receiver) = async_channel:: bounded ( 1 ) ;
104
104
105
105
if Some ( CONTINUE_HEADER_VALUE ) == req. header ( EXPECT ) . map ( |h| h. as_str ( ) ) {
106
- task :: spawn ( async move {
106
+ async_global_executor :: spawn ( async move {
107
107
// If the client expects a 100-continue header, spawn a
108
108
// task to wait for the first read attempt on the body.
109
109
if let Ok ( ( ) ) = body_read_receiver. recv ( ) . await {
@@ -112,7 +112,8 @@ where
112
112
// Since the sender is moved into the Body, this task will
113
113
// finish when the client disconnects, whether or not
114
114
// 100-continue was sent.
115
- } ) ;
115
+ } )
116
+ . detach ( ) ;
116
117
}
117
118
118
119
// Check for Transfer-Encoding
0 commit comments