Skip to content

Commit 336d754

Browse files
committed
Migrate to using libcurl for now instead of hyper
Unfortunately the move to rust-native-tls has had some hiccups on Windows and Hyper also currently doesn't support features like HTTP proxies (but support's coming soon!). For now this temporarily moves over to using libcurl to weed out these problems until we get to a point where we're hyper's features are more filled out. This also somewhat aligns with Cargo as well which is using libcurl currently. This does not use the `curl` crate on crates.io because it doesn't support streaming downloads. Instead I've got an in-progress rewrite which is just binding much more directly to libcurl's APIs (e.g. exposing the callback functions directly). This branch is in a git repo currently and I hope to upstream it to curl-rust soon as well.
1 parent fd90642 commit 336d754

File tree

15 files changed

+160
-455
lines changed

15 files changed

+160
-455
lines changed

Cargo.lock

+20-216
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rustup-cli/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use errors::*;
66
use rustup_utils::utils;
77
use rustup_utils::notify::NotificationLevel;
88
use self_update;
9-
use std::io::{Write, Read, BufRead};
9+
use std::io::{Write, BufRead};
1010
use std::process::Command;
1111
use std::{cmp, iter};
1212
use std::str::FromStr;

src/rustup-cli/self_update.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
//! and racy on Windows.
3232
3333
use common::{self, Confirm};
34-
use itertools::Itertools;
3534
use rustup::{NotifyHandler};
3635
use errors::*;
3736
use rustup_dist::dist;
@@ -1069,7 +1068,7 @@ pub fn prepare_update() -> Result<Option<PathBuf>> {
10691068
info!("checking for self-updates");
10701069
let hash_url = try!(utils::parse_url(&(url.clone() + ".sha256")));
10711070
let hash_file = tempdir.path().join("hash");
1072-
try!(utils::download_file(hash_url, &hash_file, None, ntfy!(&NotifyHandler::none())));
1071+
try!(utils::download_file(&hash_url, &hash_file, None, ntfy!(&NotifyHandler::none())));
10731072
let mut latest_hash = try!(utils::read_file("hash", &hash_file));
10741073
latest_hash.truncate(64);
10751074

@@ -1085,7 +1084,7 @@ pub fn prepare_update() -> Result<Option<PathBuf>> {
10851084
// Download new version
10861085
info!("downloading self-update");
10871086
let mut hasher = Sha256::new();
1088-
try!(utils::download_file(download_url,
1087+
try!(utils::download_file(&download_url,
10891088
&setup_path,
10901089
Some(&mut hasher),
10911090
ntfy!(&NotifyHandler::none())));

0 commit comments

Comments
 (0)