mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-26 20:38:43 -05:00
update most deps, notably including reqwest
Fixes #60 The reqwest dependency is significant because the old version required an old version of openssl, complicating compilation on newer platforms. reqwest also pulled in old/duplicate versions of hyper, tokio, etc. Nice to drop a lot of that cruft. I left rusqlite and uuid alone because they had breaking changes I didn't want to mess with at the moment. Bumped the minimum Rust version to 1.30.0, as required by the new encoding_rs crate (and perhaps other things).
This commit is contained in:
@@ -1456,7 +1456,7 @@ impl FileInner {
|
||||
let start = s.s.sample_file_range().start + r.start;
|
||||
let mmap = Box::new(unsafe {
|
||||
memmap::MmapOptions::new()
|
||||
.offset(start as usize)
|
||||
.offset(start)
|
||||
.len((r.end - r.start) as usize)
|
||||
.map(&f)?
|
||||
});
|
||||
@@ -2204,6 +2204,7 @@ mod bench {
|
||||
use db::testutil::{self, TestDb};
|
||||
use futures::{Future, future};
|
||||
use hyper;
|
||||
use http::header;
|
||||
use http_serve;
|
||||
use self::test::Bencher;
|
||||
use std::error::Error as StdError;
|
||||
@@ -2298,10 +2299,9 @@ mod bench {
|
||||
b.bytes = p;
|
||||
let client = reqwest::Client::new();
|
||||
let mut run = || {
|
||||
use self::reqwest::header::{Range, ByteRangeSpec};
|
||||
let mut resp =
|
||||
client.get(server.url.clone())
|
||||
.header(Range::Bytes(vec![ByteRangeSpec::FromTo(0, p - 1)]))
|
||||
.header(header::RANGE, format!("bytes=0-{}", p - 1))
|
||||
.send()
|
||||
.unwrap();
|
||||
buf.clear();
|
||||
|
||||
@@ -621,7 +621,7 @@ mod bench {
|
||||
let client = reqwest::Client::new();
|
||||
let mut f = || {
|
||||
let mut resp = client.get(url.clone()).send().unwrap();
|
||||
assert_eq!(resp.status(), reqwest::StatusCode::Ok);
|
||||
assert_eq!(resp.status(), reqwest::StatusCode::OK);
|
||||
buf.clear();
|
||||
use std::io::Read;
|
||||
resp.read_to_end(&mut buf).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user