summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-09-29 12:59:48 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2021-10-07 16:01:05 +0200
commitfd81d6571654d3d6e6440d964fed87c026dbf011 (patch)
treea1d2b2c9db47267043f869b48f46a30b36590ff8
parent6d52c8eb14e37d67f05148e8ea2cc828c9b84468 (diff)
ffi: Update to tokio 1.0.
-rw-r--r--Cargo.lock2
-rw-r--r--ffi/Cargo.toml2
-rw-r--r--ffi/src/net.rs7
3 files changed, 5 insertions, 6 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 7fbba95b..19553079 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2409,7 +2409,7 @@ dependencies = [
"sequoia-net",
"sequoia-openpgp",
"sequoia-store",
- "tokio 0.2.25",
+ "tokio 1.12.0",
]
[[package]]
diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml
index 60c8e8c8..0fcc53f6 100644
--- a/ffi/Cargo.toml
+++ b/ffi/Cargo.toml
@@ -32,7 +32,7 @@ lazy_static = "1.4.0"
libc = "0.2.66"
memsec = { version = ">=0.5", default-features = false }
native-tls = "0.2.0"
-tokio = { version = "0.2.19", features = ["rt-core", "io-driver", "io-util", "time"] }
+tokio = { version = "1", features = ["rt", "time"] }
[dev-dependencies]
filetime = "0.2"
diff --git a/ffi/src/net.rs b/ffi/src/net.rs
index ce1888b8..c8f03289 100644
--- a/ffi/src/net.rs
+++ b/ffi/src/net.rs
@@ -127,7 +127,7 @@ fn sq_keyserver_get(ctx: *mut Context,
let ks = ffi_param_ref_mut!(ks);
let id = id.ref_raw().clone();
- let mut core = ffi_try_or!(basic_runtime(), None);
+ let core = ffi_try_or!(basic_runtime(), None);
core.block_on(ks.get(id)).move_into_raw(Some(ctx.errp()))
}
@@ -146,13 +146,12 @@ fn sq_keyserver_send(ctx: *mut Context,
ffi_try_status!(basic_runtime()
.map_err(|e| e.into())
- .and_then(|mut rt| rt.block_on(ks.send(cert))))
+ .and_then(|rt| rt.block_on(ks.send(cert))))
}
/// Constructs a basic Tokio runtime.
fn basic_runtime() -> tokio::io::Result<tokio::runtime::Runtime> {
- tokio::runtime::Builder::new()
- .basic_scheduler()
+ tokio::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()