@@ -251,7 +251,7 @@ where
251
251
if req. version ( ) == Version :: HTTP_2 {
252
252
warn ! ( "Connection is HTTP/1, but request requires HTTP/2" ) ;
253
253
return Err ( ClientError :: Normal (
254
- crate :: Error :: new_user_unsupported_version ( ) ,
254
+ crate :: Error :: new_user_unsupported_version ( ) . with_client_connect_info ( pooled . conn_info . clone ( ) ) ,
255
255
) ) ;
256
256
}
257
257
@@ -281,18 +281,20 @@ where
281
281
authority_form ( req. uri_mut ( ) ) ;
282
282
}
283
283
284
- let fut = pooled
285
- . send_request_retryable ( req)
286
- . map_err ( ClientError :: map_with_reused ( pooled. is_reused ( ) ) ) ;
284
+ let mut res = match pooled. send_request_retryable ( req) . await {
285
+ Err ( ( err, orig_req) ) => {
286
+ return Err ( ClientError :: map_with_reused ( pooled. is_reused ( ) ) ( (
287
+ err. with_client_connect_info ( pooled. conn_info . clone ( ) ) ,
288
+ orig_req,
289
+ ) ) ) ;
290
+ }
291
+ Ok ( res) => res,
292
+ } ;
287
293
288
294
// If the Connector included 'extra' info, add to Response...
289
- let extra_info = pooled. conn_info . extra . clone ( ) ;
290
- let fut = fut. map_ok ( move |mut res| {
291
- if let Some ( extra) = extra_info {
292
- extra. set ( res. extensions_mut ( ) ) ;
293
- }
294
- res
295
- } ) ;
295
+ if let Some ( extra) = & pooled. conn_info . extra {
296
+ extra. set ( res. extensions_mut ( ) ) ;
297
+ }
296
298
297
299
// As of [email protected] , there is a race condition in the mpsc
298
300
// channel, such that sending when the receiver is closing can
@@ -302,11 +304,9 @@ where
302
304
// To counteract this, we must check if our senders 'want' channel
303
305
// has been closed after having tried to send. If so, error out...
304
306
if pooled. is_closed ( ) {
305
- return fut . await ;
307
+ return Ok ( res ) ;
306
308
}
307
309
308
- let mut res = fut. await ?;
309
-
310
310
// If pooled is HTTP/2, we can toss this reference immediately.
311
311
//
312
312
// when pooled is dropped, it will try to insert back into the
0 commit comments