Skip to content

Commit

Permalink
Replace hyper-0.10 with reqwest
Browse files Browse the repository at this point in the history
Later versions of hyper (0.11, 0.12) have dropped a number of features,
and reqwest has picked up those features. This change migrates the HTTP
code from using an old version of hyper to using the latest version of
reqwest.

Other changes:
* Remove old and unused hyper_seekable
* Add UnexpectedHttpResponse
  • Loading branch information
spl committed Apr 1, 2019
1 parent e186cbb commit 99e3665
Show file tree
Hide file tree
Showing 8 changed files with 676 additions and 415 deletions.
658 changes: 611 additions & 47 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ clap = "^2.29"
error-chain = "^0.12"
flate2 = "^1.0"
fs2 = "^0.4"
hyper = "^0.10"
hyper-native-tls = "^0.3"
lazy_static = "^1.2"
libc = "^0.2"
tempfile = "^3.0"
md-5 = "^0.8"
reqwest = "^0.9"
sha2 = "^0.8"
serde = { version = "^1.0", features = ["derive"], optional = true }
tectonic_xdv = { path = "xdv", version = "0.1.9-dev" }
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl PersistentConfig {
only_cached: bool,
status: &mut StatusBackend,
) -> Result<Box<Bundle>> {
use hyper::Url;
use reqwest::Url;
use std::io;

if CONFIG_TEST_MODE_ACTIVATED.load(Ordering::SeqCst) {
Expand Down
9 changes: 7 additions & 2 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![allow(deprecated)]

use app_dirs;
use hyper;
use reqwest::StatusCode;
use std::io::Write;
use std::result::Result as StdResult;
use std::{convert, ffi, io, num, str};
Expand All @@ -27,11 +27,11 @@ error_chain! {

foreign_links {
AppDirs(app_dirs::AppDirsError);
Hyper(hyper::Error);
Io(io::Error);
Nul(ffi::NulError);
ParseInt(num::ParseIntError);
Persist(tempfile::PersistError);
Reqwest(reqwest::Error);
TomlDe(toml::de::Error);
TomlSer(toml::ser::Error);
Utf8(str::Utf8Error);
Expand Down Expand Up @@ -64,6 +64,11 @@ error_chain! {
description("some engine had an unrecoverable error")
display("the {} engine had an unrecoverable error", engine)
}

UnexpectedHttpResponse(url: String, status: StatusCode) {
description("unexpected HTTP response to URL")
display("unexpected HTTP response to URL {}: {}", url, status)
}
}
}

Expand Down
311 changes: 0 additions & 311 deletions src/io/hyper_seekable.rs

This file was deleted.

Loading

0 comments on commit 99e3665

Please sign in to comment.