summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/src/async.rs11
-rw-r--r--net/src/lib.rs4
-rw-r--r--store/src/backend/mod.rs11
3 files changed, 12 insertions, 14 deletions
diff --git a/net/src/async.rs b/net/src/async.rs
index 0b000e84..68a5b61f 100644
--- a/net/src/async.rs
+++ b/net/src/async.rs
@@ -13,7 +13,6 @@ use native_tls::{Certificate, TlsConnector};
use percent_encoding::{percent_encode, DEFAULT_ENCODE_SET};
use std::convert::From;
use std::io::Cursor;
-use tokio_core::reactor::Handle;
use url::Url;
use openpgp::TPK;
@@ -43,7 +42,7 @@ const DNS_WORKER: usize = 4;
impl KeyServer {
/// Returns a handle for the given URI.
- pub fn new(ctx: &Context, uri: &str, _handle: &Handle) -> Result<Self> {
+ pub fn new(ctx: &Context, uri: &str) -> Result<Self> {
let uri: Url = uri.parse()
.or_else(|_| format!("hkps://{}", uri).parse())?;
@@ -62,8 +61,8 @@ impl KeyServer {
/// Returns a handle for the given URI.
///
/// `cert` is used to authenticate the server.
- pub fn with_cert(ctx: &Context, uri: &str, cert: Certificate,
- _handle: &Handle) -> Result<Self> {
+ pub fn with_cert(ctx: &Context, uri: &str, cert: Certificate)
+ -> Result<Self> {
let uri: Url = uri.parse()?;
let client: Box<AClient> = {
@@ -85,11 +84,11 @@ impl KeyServer {
/// The pool `hkps://hkps.pool.sks-keyservers.net` provides HKP
/// services over https. It is authenticated using a certificate
/// included in this library. It is a good default choice.
- pub fn sks_pool(ctx: &Context, handle: &Handle) -> Result<Self> {
+ pub fn sks_pool(ctx: &Context) -> Result<Self> {
let uri = "hkps://hkps.pool.sks-keyservers.net";
let cert = Certificate::from_der(
include_bytes!("sks-keyservers.netCA.der")).unwrap();
- Self::with_cert(ctx, uri, cert, handle)
+ Self::with_cert(ctx, uri, cert)
}
/// Common code for the above functions.
diff --git a/net/src/lib.rs b/net/src/lib.rs
index 53fcc2dd..45415e67 100644
--- a/net/src/lib.rs
+++ b/net/src/lib.rs
@@ -77,7 +77,7 @@ impl KeyServer {
/// Returns a handle for the given URI.
pub fn new(ctx: &Context, uri: &str) -> Result<Self> {
let core = Core::new()?;
- let ks = async::KeyServer::new(ctx, uri, &core.handle())?;
+ let ks = async::KeyServer::new(ctx, uri)?;
Ok(KeyServer{core: core, ks: ks})
}
@@ -86,7 +86,7 @@ impl KeyServer {
/// `cert` is used to authenticate the server.
pub fn with_cert(ctx: &Context, uri: &str, cert: Certificate) -> Result<Self> {
let core = Core::new()?;
- let ks = async::KeyServer::with_cert(ctx, uri, cert, &core.handle())?;
+ let ks = async::KeyServer::with_cert(ctx, uri, cert)?;
Ok(KeyServer{core: core, ks: ks})
}
diff --git a/store/src/backend/mod.rs b/store/src/backend/mod.rs
index 6891babe..7753db58 100644
--- a/store/src/backend/mod.rs
+++ b/store/src/backend/mod.rs
@@ -873,7 +873,7 @@ impl KeyServer {
}
/// Helper for `update`.
- fn update_helper(c: &Rc<Connection>, handle: &Handle,
+ fn update_helper(c: &Rc<Connection>,
network_policy: core::NetworkPolicy)
-> Result<(KeyServer,
openpgp::KeyID,
@@ -896,7 +896,7 @@ impl KeyServer {
let ctx = core::Context::configure()
.network_policy(network_policy).build()?;
- let keyserver = net::async::KeyServer::sks_pool(&ctx, handle)?;
+ let keyserver = net::async::KeyServer::sks_pool(&ctx)?;
Ok((KeyServer::new(c.clone(), id),
fingerprint.to_keyid(),
@@ -904,11 +904,11 @@ impl KeyServer {
}
/// Updates the key that was least recently updated.
- fn update(c: &Rc<Connection>, handle: &Handle,
+ fn update(c: &Rc<Connection>,
network_policy: core::NetworkPolicy)
-> Box<Future<Item=Duration, Error=failure::Error> + 'static> {
let (key, id, mut keyserver)
- = match Self::update_helper(c, handle, network_policy) {
+ = match Self::update_helper(c, network_policy) {
Ok((key, id, keyserver)) => (key, id, keyserver),
Err(e) => return Box::new(future::err(e.into())),
};
@@ -952,8 +952,7 @@ impl KeyServer {
let network_policy = core::NetworkPolicy::Encrypted;
let h1 = h0.clone();
-
- Self::update(&c, &h0, network_policy)
+ Self::update(&c, network_policy)
.then(move |d| {
let d = d.unwrap_or(min_sleep_time());
Timeout::new(