mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-25 06:35:56 -05:00
update dependencies
This commit is contained in:
parent
16ed7f73ba
commit
5c8970fe8a
648
Cargo.lock
generated
648
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
22
Cargo.toml
22
Cargo.toml
@ -26,19 +26,19 @@ lazy_static = "0.2"
|
||||
libc = "0.2"
|
||||
log = { version = "0.3", features = ["release_max_level_info"] }
|
||||
lru-cache = "0.1"
|
||||
memmap = "0.5"
|
||||
memmap = "0.6"
|
||||
mime = "0.3"
|
||||
moonfire-ffmpeg = { path = "ffmpeg" }
|
||||
mylog = { git = "https://github.com/scottlamb/mylog" }
|
||||
openssl = "0.9"
|
||||
parking_lot = { version = "0.4", features = [] }
|
||||
parking_lot = { version = "0.5", features = [] }
|
||||
reffers = { git = "https://github.com/diwic/reffers-rs" }
|
||||
regex = "0.2"
|
||||
rusqlite = "0.12"
|
||||
rusqlite = "0.13"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
smallvec = "0.4"
|
||||
smallvec = "0.5"
|
||||
time = "0.1"
|
||||
tokio-core = "0.1"
|
||||
tokio-signal = "0.1"
|
||||
@ -46,11 +46,11 @@ url = "1.4"
|
||||
uuid = { version = "0.5", features = ["serde", "v4"] }
|
||||
|
||||
[dev-dependencies]
|
||||
reqwest = "0.7"
|
||||
reqwest = "0.8"
|
||||
tempdir = "0.3"
|
||||
|
||||
[dependencies.cursive]
|
||||
version = "0.5"
|
||||
version = "0.7"
|
||||
#default-features = false
|
||||
#features = ["termion-backend"]
|
||||
|
||||
@ -63,12 +63,4 @@ debug = true
|
||||
[replace]
|
||||
|
||||
# This hyper fork has a patch to disable Nagle's algorithm.
|
||||
"hyper:0.11.2" = { git = "https://github.com/scottlamb/hyper", branch = "moonfire-on-0.11.x" }
|
||||
|
||||
# The libc crate just added OS X support for clock_gettime, which Moonfire NVR
|
||||
# needs. There hasn't been a release, so go straight to git for the moment.
|
||||
# Do it for all platforms because [target.foo.replace] is apparently
|
||||
# unsupported.
|
||||
#[target.'cfg(target_os = "macos")'.replace]
|
||||
#[target.x86_64-apple-darwin.replace]
|
||||
"libc:0.2.31" = { git = "https://github.com/rust-lang/libc" }
|
||||
"hyper:0.11.7" = { git = "https://github.com/scottlamb/hyper", branch = "moonfire-on-0.11.x" }
|
||||
|
@ -85,13 +85,15 @@ fn open_conn(db_dir: &str, mode: OpenMode) -> Result<(dir::Fd, rusqlite::Connect
|
||||
let conn = rusqlite::Connection::open_with_flags(
|
||||
Path::new(&db_dir).join("db"),
|
||||
match mode {
|
||||
OpenMode::ReadOnly => rusqlite::SQLITE_OPEN_READ_ONLY,
|
||||
OpenMode::ReadWrite => rusqlite::SQLITE_OPEN_READ_WRITE,
|
||||
OpenMode::Create => rusqlite::SQLITE_OPEN_READ_WRITE | rusqlite::SQLITE_OPEN_CREATE,
|
||||
OpenMode::ReadOnly => rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY,
|
||||
OpenMode::ReadWrite => rusqlite::OpenFlags::SQLITE_OPEN_READ_WRITE,
|
||||
OpenMode::Create => {
|
||||
rusqlite::OpenFlags::SQLITE_OPEN_READ_WRITE | rusqlite::OpenFlags::SQLITE_OPEN_CREATE
|
||||
},
|
||||
} |
|
||||
// rusqlite::Connection is not Sync, so there's no reason to tell SQLite3 to use the
|
||||
// serialized threading mode.
|
||||
rusqlite::SQLITE_OPEN_NO_MUTEX)?;
|
||||
rusqlite::OpenFlags::SQLITE_OPEN_NO_MUTEX)?;
|
||||
Ok((dir, conn))
|
||||
}
|
||||
|
||||
|
14
src/mp4.rs
14
src/mp4.rs
@ -1457,9 +1457,14 @@ impl FileInner {
|
||||
};
|
||||
let f = self.dir.open_sample_file(uuid)?;
|
||||
let start = s.s.sample_file_range().start + r.start;
|
||||
let mmap = Box::new(memmap::Mmap::open_with_offset(
|
||||
&f, memmap::Protection::Read, start as usize, (r.end - r.start) as usize)?);
|
||||
Ok(ARefs::new(mmap).map(|m| unsafe { m.as_slice() }))
|
||||
let mmap = Box::new(unsafe {
|
||||
memmap::MmapOptions::new()
|
||||
.offset(start as usize)
|
||||
.len((r.end - r.start) as usize)
|
||||
.map(&f)?
|
||||
});
|
||||
use core::ops::Deref;
|
||||
Ok(ARefs::new(mmap).map(|m| m.deref()))
|
||||
}
|
||||
|
||||
fn get_subtitle_sample_data(&self, i: usize, r: Range<u64>, l: u64) -> Result<Chunk, Error> {
|
||||
@ -2278,12 +2283,11 @@ mod bench {
|
||||
let p = server.generated_len;
|
||||
let mut buf = Vec::with_capacity(p as usize);
|
||||
b.bytes = p;
|
||||
let client = reqwest::Client::new().unwrap();
|
||||
let client = reqwest::Client::new();
|
||||
let mut run = || {
|
||||
use self::reqwest::header::{Range, ByteRangeSpec};
|
||||
let mut resp =
|
||||
client.get(server.url.clone())
|
||||
.unwrap()
|
||||
.header(Range::Bytes(vec![ByteRangeSpec::FromTo(0, p - 1)]))
|
||||
.send()
|
||||
.unwrap();
|
||||
|
@ -527,7 +527,7 @@ mod bench {
|
||||
::std::thread::spawn(move || {
|
||||
let addr = "127.0.0.1:0".parse().unwrap();
|
||||
let (db, dir) = (db.db.clone(), db.dir.clone());
|
||||
let service = super::Service::new(db.clone(), dir.clone(), None);
|
||||
let service = super::Service::new(db.clone(), dir.clone(), None, "".to_owned()).unwrap();
|
||||
let server = hyper::server::Http::new()
|
||||
.bind(&addr, move || Ok(service.clone()))
|
||||
.unwrap();
|
||||
@ -547,12 +547,12 @@ mod bench {
|
||||
fn serve_camera_recordings(b: &mut Bencher) {
|
||||
testutil::init();
|
||||
let server = &*SERVER;
|
||||
let url = reqwest::Url::parse(&format!("{}/cameras/{}/recordings", server.base_url,
|
||||
let url = reqwest::Url::parse(&format!("{}/api/cameras/{}/recordings", server.base_url,
|
||||
*testutil::TEST_CAMERA_UUID)).unwrap();
|
||||
let mut buf = Vec::new();
|
||||
let client = reqwest::Client::new().unwrap();
|
||||
let client = reqwest::Client::new();
|
||||
let mut f = || {
|
||||
let mut resp = client.get(url.clone()).unwrap().send().unwrap();
|
||||
let mut resp = client.get(url.clone()).send().unwrap();
|
||||
assert_eq!(resp.status(), reqwest::StatusCode::Ok);
|
||||
buf.clear();
|
||||
use std::io::Read;
|
||||
|
Loading…
Reference in New Issue
Block a user