@@ -251,7 +251,7 @@ where
251251 if req. version ( ) == Version :: HTTP_2 {
252252 warn ! ( "Connection is HTTP/1, but request requires HTTP/2" ) ;
253253 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 ( ) ) ,
255255 ) ) ;
256256 }
257257
@@ -281,18 +281,20 @@ where
281281 authority_form ( req. uri_mut ( ) ) ;
282282 }
283283
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+ } ;
287293
288294 // 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+ }
296298
297299 // As of futures@0.1.21, there is a race condition in the mpsc
298300 // channel, such that sending when the receiver is closing can
@@ -302,11 +304,9 @@ where
302304 // To counteract this, we must check if our senders 'want' channel
303305 // has been closed after having tried to send. If so, error out...
304306 if pooled. is_closed ( ) {
305- return fut . await ;
307+ return Ok ( res ) ;
306308 }
307309
308- let mut res = fut. await ?;
309-
310310 // If pooled is HTTP/2, we can toss this reference immediately.
311311 //
312312 // when pooled is dropped, it will try to insert back into the
0 commit comments