Skip to content

Commit 99e3665

Browse files
committed
Replace hyper-0.10 with reqwest
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
1 parent e186cbb commit 99e3665

File tree

8 files changed

+676
-415
lines changed

8 files changed

+676
-415
lines changed

Cargo.lock

Lines changed: 611 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ clap = "^2.29"
4444
error-chain = "^0.12"
4545
flate2 = "^1.0"
4646
fs2 = "^0.4"
47-
hyper = "^0.10"
48-
hyper-native-tls = "^0.3"
4947
lazy_static = "^1.2"
5048
libc = "^0.2"
5149
tempfile = "^3.0"
5250
md-5 = "^0.8"
51+
reqwest = "^0.9"
5352
sha2 = "^0.8"
5453
serde = { version = "^1.0", features = ["derive"], optional = true }
5554
tectonic_xdv = { path = "xdv", version = "0.1.9-dev" }

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl PersistentConfig {
149149
only_cached: bool,
150150
status: &mut StatusBackend,
151151
) -> Result<Box<Bundle>> {
152-
use hyper::Url;
152+
use reqwest::Url;
153153
use std::io;
154154

155155
if CONFIG_TEST_MODE_ACTIVATED.load(Ordering::SeqCst) {

src/errors.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![allow(deprecated)]
1212

1313
use app_dirs;
14-
use hyper;
14+
use reqwest::StatusCode;
1515
use std::io::Write;
1616
use std::result::Result as StdResult;
1717
use std::{convert, ffi, io, num, str};
@@ -27,11 +27,11 @@ error_chain! {
2727

2828
foreign_links {
2929
AppDirs(app_dirs::AppDirsError);
30-
Hyper(hyper::Error);
3130
Io(io::Error);
3231
Nul(ffi::NulError);
3332
ParseInt(num::ParseIntError);
3433
Persist(tempfile::PersistError);
34+
Reqwest(reqwest::Error);
3535
TomlDe(toml::de::Error);
3636
TomlSer(toml::ser::Error);
3737
Utf8(str::Utf8Error);
@@ -64,6 +64,11 @@ error_chain! {
6464
description("some engine had an unrecoverable error")
6565
display("the {} engine had an unrecoverable error", engine)
6666
}
67+
68+
UnexpectedHttpResponse(url: String, status: StatusCode) {
69+
description("unexpected HTTP response to URL")
70+
display("unexpected HTTP response to URL {}: {}", url, status)
71+
}
6772
}
6873
}
6974

src/io/hyper_seekable.rs

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)