File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -571,8 +571,11 @@ impl Builder {
571
571
///
572
572
/// Default is 90 seconds.
573
573
#[ inline]
574
- pub fn keep_alive_timeout ( & mut self , val : Option < Duration > ) -> & mut Self {
575
- self . keep_alive_timeout = val;
574
+ pub fn keep_alive_timeout < D > ( & mut self , val : D ) -> & mut Self
575
+ where
576
+ D : Into < Option < Duration > > ,
577
+ {
578
+ self . keep_alive_timeout = val. into ( ) ;
576
579
self
577
580
}
578
581
Original file line number Diff line number Diff line change @@ -192,12 +192,14 @@ pub fn __run_test(cfg: __TestConfig) {
192
192
use hyper:: { Body , Client , Request , Response } ;
193
193
use hyper:: client:: HttpConnector ;
194
194
use std:: sync:: { Arc , Mutex } ;
195
+ use std:: time:: Duration ;
195
196
let _ = pretty_env_logger:: try_init ( ) ;
196
197
let rt = Runtime :: new ( ) . expect ( "new rt" ) ;
197
198
let handle = rt. reactor ( ) . clone ( ) ;
198
199
199
200
let connector = HttpConnector :: new_with_handle ( 1 , handle. clone ( ) ) ;
200
201
let client = Client :: builder ( )
202
+ . keep_alive_timeout ( Duration :: from_secs ( 10 ) )
201
203
. http2_only ( cfg. client_version == 2 )
202
204
. executor ( rt. executor ( ) )
203
205
. build :: < _ , Body > ( connector) ;
You can’t perform that action at this time.
0 commit comments