Skip to content

Commit

Permalink
Migrate to using libcurl for now instead of hyper
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton committed May 10, 2016
1 parent fd90642 commit 3eaf5ec
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 451 deletions.
235 changes: 19 additions & 216 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/rustup-cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use errors::*;
use rustup_utils::utils;
use rustup_utils::notify::NotificationLevel;
use self_update;
use std::io::{Write, Read, BufRead};
use std::io::{Write, BufRead};
use std::process::Command;
use std::{cmp, iter};
use std::str::FromStr;
Expand Down
5 changes: 2 additions & 3 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
//! and racy on Windows.
use common::{self, Confirm};
use itertools::Itertools;
use rustup::{NotifyHandler};
use errors::*;
use rustup_dist::dist;
Expand Down Expand Up @@ -1069,7 +1068,7 @@ pub fn prepare_update() -> Result<Option<PathBuf>> {
info!("checking for self-updates");
let hash_url = try!(utils::parse_url(&(url.clone() + ".sha256")));
let hash_file = tempdir.path().join("hash");
try!(utils::download_file(hash_url, &hash_file, None, ntfy!(&NotifyHandler::none())));
try!(utils::download_file(&hash_url, &hash_file, None, ntfy!(&NotifyHandler::none())));
let mut latest_hash = try!(utils::read_file("hash", &hash_file));
latest_hash.truncate(64);

Expand All @@ -1085,7 +1084,7 @@ pub fn prepare_update() -> Result<Option<PathBuf>> {
// Download new version
info!("downloading self-update");
let mut hasher = Sha256::new();
try!(utils::download_file(download_url,
try!(utils::download_file(&download_url,
&setup_path,
Some(&mut hasher),
ntfy!(&NotifyHandler::none())));
Expand Down
Loading

0 comments on commit 3eaf5ec

Please sign in to comment.