diff options
-rw-r--r-- | Cargo.lock | 23 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | ipc/Cargo.toml | 32 | ||||
-rw-r--r-- | ipc/README.md | 2 | ||||
-rw-r--r-- | ipc/src/lib.rs (renamed from net/src/ipc.rs) | 21 | ||||
-rw-r--r-- | net/Cargo.toml | 7 | ||||
-rw-r--r-- | net/src/lib.rs | 4 | ||||
-rw-r--r-- | store/Cargo.toml | 1 | ||||
-rw-r--r-- | store/src/backend/mod.rs | 2 | ||||
-rw-r--r-- | store/src/lib.rs | 3 | ||||
-rw-r--r-- | store/src/server.rs | 4 |
11 files changed, 79 insertions, 21 deletions
@@ -1531,6 +1531,7 @@ dependencies = [ "sequoia-ffi 0.6.0", "sequoia-ffi-macros 0.6.0", "sequoia-guide 0.6.0", + "sequoia-ipc 0.6.0", "sequoia-net 0.6.0", "sequoia-openpgp 0.6.0", "sequoia-openpgp-ffi 0.6.0", @@ -1588,18 +1589,32 @@ dependencies = [ ] [[package]] -name = "sequoia-net" +name = "sequoia-ipc" version = "0.6.0" dependencies = [ "capnp-rpc 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "memsec 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sequoia-core 0.6.0", + "sequoia-openpgp 0.6.0", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sequoia-net" +version = "0.6.0" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.27 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", - "memsec 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1652,6 +1667,9 @@ dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "lalrpop 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)", "lalrpop-util 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quickcheck 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1677,6 +1695,7 @@ dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rusqlite 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "sequoia-core 0.6.0", + "sequoia-ipc 0.6.0", "sequoia-net 0.6.0", "sequoia-openpgp 0.6.0", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -29,6 +29,7 @@ sequoia-openpgp-ffi = { path = "openpgp-ffi", version = "0.6" } sequoia-core = { path = "core", version = "0.6" } sequoia-ffi = { path = "ffi", version = "0.6" } sequoia-ffi-macros = { path = "ffi-macros", version = "0.6" } +sequoia-ipc = { path = "ipc", version = "0.6" } sequoia-net = { path = "net", version = "0.6" } sequoia-store = { path = "store", version = "0.6" } sequoia-tool = { path = "tool", version = "0.6" } diff --git a/ipc/Cargo.toml b/ipc/Cargo.toml new file mode 100644 index 00000000..27b9aaa0 --- /dev/null +++ b/ipc/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "sequoia-ipc" +description = "Interprocess communication infrastructure for Sequoia" +version = "0.6.0" +authors = [ + "Justus Winter <justus@sequoia-pgp.org>", + "Kai Michaelis <kai@sequoia-pgp.org>", + "Neal H. Walfield <neal@sequoia-pgp.org>", +] +documentation = "https://docs.sequoia-pgp.org/sequoia_ipc" +homepage = "https://sequoia-pgp.org/" +repository = "https://gitlab.com/sequoia-pgp/sequoia" +readme = "README.md" +license = "GPL-3.0" + +[badges] +gitlab = { repository = "sequoia-pgp/sequoia" } +maintenance = { status = "actively-developed" } + +[dependencies] +sequoia-openpgp = { path = "../openpgp" } +sequoia-core = { path = "../core" } + +capnp-rpc = "0.9" +failure = "0.1.2" +fs2 = "0.4.2" +futures = "0.1" +libc = "0.2.33" +memsec = "0.5.4" +rand = "0.6" +tokio-core = "0.1" +tokio-io = "0.1.4" diff --git a/ipc/README.md b/ipc/README.md new file mode 100644 index 00000000..d1820a87 --- /dev/null +++ b/ipc/README.md @@ -0,0 +1,2 @@ +Sequoia uses this to communicate with backend servers. This is an +implementation detail. Do not use this crate. diff --git a/net/src/ipc.rs b/ipc/src/lib.rs index 17ddacf0..70ef3cf1 100644 --- a/net/src/ipc.rs +++ b/ipc/src/lib.rs @@ -36,18 +36,24 @@ //! Windows support is currently not implemented, but should be //! straight forward. -extern crate fs2; -use self::fs2::FileExt; - use std::fs; use std::io::{self, Read, Write}; use std::net::{SocketAddr, AddrParseError, TcpStream, TcpListener}; use std::path::PathBuf; +extern crate capnp_rpc; +#[macro_use] extern crate failure; +extern crate fs2; +extern crate futures; +extern crate memsec; +extern crate tokio_core; +extern crate tokio_io; + +use failure::Fallible as Result; +use fs2::FileExt; use futures::{Future, Stream}; -use tokio_core::{self, net}; -use tokio_io; +use tokio_core::net; use tokio_io::io::{ReadHalf, ReadExact}; use tokio_io::AsyncRead; @@ -65,8 +71,9 @@ use std::os::unix::io::AsRawFd; use std::thread; +extern crate sequoia_core; + use sequoia_core as core; -use super::Result; /// Servers need to implement this trait. pub trait Handler { @@ -332,7 +339,7 @@ impl Server { /// extern crate sequoia_net; /// extern crate sequoia_store; /// - /// use sequoia_net::ipc::Server; + /// use sequoia_ipc::Server; /// /// fn main() { /// let ctx = Server::context() diff --git a/net/Cargo.toml b/net/Cargo.toml index 1974c308..ef837b8c 100644 --- a/net/Cargo.toml +++ b/net/Cargo.toml @@ -23,18 +23,17 @@ maintenance = { status = "actively-developed" } sequoia-openpgp = { path = "../openpgp", version = "0.6" } sequoia-core = { path = "../core", version = "0.6" } -capnp-rpc = "0.9" failure = "0.1.2" -fs2 = "0.4.2" futures = "0.1" http = "0.1.5" hyper = "0.12" hyper-tls = "0.3" libc = "0.2.33" -memsec = "0.5.4" native-tls = "0.2.0" percent-encoding = "1.0.1" -rand = "0.6" tokio-core = "0.1" tokio-io = "0.1.4" url = "1.6.0" + +[dev-dependencies] +rand = "0.6" diff --git a/net/src/lib.rs b/net/src/lib.rs index fc674df5..db52333d 100644 --- a/net/src/lib.rs +++ b/net/src/lib.rs @@ -41,7 +41,6 @@ extern crate futures; extern crate http; extern crate hyper; extern crate hyper_tls; -extern crate memsec; extern crate native_tls; extern crate tokio_core; extern crate tokio_io; @@ -49,8 +48,6 @@ extern crate tokio_io; extern crate percent_encoding; extern crate url; -extern crate capnp_rpc; - use hyper::client::{ResponseFuture, HttpConnector}; use hyper::{Client, Request, Body}; use hyper_tls::HttpsConnector; @@ -65,7 +62,6 @@ use sequoia_core::Context; pub mod async; use async::url2uri; -pub mod ipc; /// For accessing keyservers using HKP. pub struct KeyServer { diff --git a/store/Cargo.toml b/store/Cargo.toml index 3a99bbc9..a98a433d 100644 --- a/store/Cargo.toml +++ b/store/Cargo.toml @@ -27,6 +27,7 @@ background-services = [] [dependencies] sequoia-openpgp = { path = "../openpgp", version = "0.6" } sequoia-core = { path = "../core", version = "0.6" } +sequoia-ipc = { path = "../ipc", version = "0.6" } sequoia-net = { path = "../net", version = "0.6" } capnp = "0.9.2" capnp-rpc = "0.9" diff --git a/store/src/backend/mod.rs b/store/src/backend/mod.rs index 5ec74356..0cb8d2cb 100644 --- a/store/src/backend/mod.rs +++ b/store/src/backend/mod.rs @@ -26,7 +26,7 @@ use openpgp::parse::Parse; use openpgp::serialize::Serialize; use sequoia_core as core; use sequoia_net as net; -use sequoia_net::ipc; +use sequoia_ipc as ipc; use store_protocol_capnp::node; diff --git a/store/src/lib.rs b/store/src/lib.rs index ec977b08..50dca7de 100644 --- a/store/src/lib.rs +++ b/store/src/lib.rs @@ -76,6 +76,7 @@ extern crate sequoia_openpgp as openpgp; #[allow(unused_imports)] #[macro_use] extern crate sequoia_core; +extern crate sequoia_ipc; extern crate sequoia_net; use openpgp::Fingerprint; @@ -85,7 +86,7 @@ use openpgp::parse::Parse; use openpgp::serialize::Serialize; use sequoia_core as core; use sequoia_core::Context; -use sequoia_net::ipc; +use sequoia_ipc as ipc; #[allow(dead_code)] mod store_protocol_capnp; use store_protocol_capnp::node; diff --git a/store/src/server.rs b/store/src/server.rs index 912bbd00..9c5495c1 100644 --- a/store/src/server.rs +++ b/store/src/server.rs @@ -1,8 +1,8 @@ extern crate sequoia_core; -extern crate sequoia_net; +extern crate sequoia_ipc; extern crate sequoia_store; -use sequoia_net::ipc::Server; +use sequoia_ipc::Server; fn main() { let ctx = Server::context() |