@@ -367,12 +367,7 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
367
367
// connect phase as well as a "low speed" timeout so if we don't receive
368
368
// many bytes in a large-ish period of time then we time out.
369
369
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) ?) ?;
376
371
if let Some ( proxy) = http_proxy ( config) ? {
377
372
handle. proxy ( & proxy) ?;
378
373
}
@@ -395,19 +390,11 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
395
390
}
396
391
397
392
/// 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 > {
399
394
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) ;
409
396
}
410
- Ok ( Some ( Duration :: new ( 30 , 0 ) ) )
397
+ Ok ( 10 )
411
398
}
412
399
413
400
/// Find an explicit HTTP proxy if one is available.
0 commit comments