@@ -367,12 +367,7 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
367367 // connect phase as well as a "low speed" timeout so if we don't receive
368368 // many bytes in a large-ish period of time then we time out.
369369 handle. connect_timeout ( Duration :: new ( 30 , 0 ) ) ?;
370- if let Some ( config_low_speed_limit) = low_speed_limit ( config) ? {
371- handle. low_speed_limit ( config_low_speed_limit) ?;
372- }
373- if let Some ( config_low_speed_time) = low_speed_time ( config) ? {
374- handle. low_speed_time ( config_low_speed_time) ?;
375- }
370+ handle. low_speed_limit ( http_low_speed_limit ( config) ?) ?;
376371 if let Some ( proxy) = http_proxy ( config) ? {
377372 handle. proxy ( & proxy) ?;
378373 }
@@ -395,19 +390,11 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
395390}
396391
397392/// Find an override from config for curl low-speed-limit option, otherwise use default value
398- fn low_speed_limit ( config : & Config ) -> CargoResult < Option < u32 > > {
393+ fn http_low_speed_limit ( config : & Config ) -> CargoResult < u32 > {
399394 if let Some ( s) = config. get :: < Option < u32 > > ( "http.low-speed-limit" ) ? {
400- return Ok ( Some ( s) ) ;
401- }
402- Ok ( Some ( 10 ) )
403- }
404-
405- /// Find an override from config for curl low-speed-time option, otherwise use default value
406- fn low_speed_time ( config : & Config ) -> CargoResult < Option < Duration > > {
407- if let Some ( s) = config. get :: < Option < u64 > > ( "http.low-speed-time" ) ? {
408- return Ok ( Some ( Duration :: new ( s, 0 ) ) ) ;
395+ return Ok ( s) ;
409396 }
410- Ok ( Some ( Duration :: new ( 30 , 0 ) ) )
397+ Ok ( 10 )
411398}
412399
413400/// Find an explicit HTTP proxy if one is available.
0 commit comments