summaryrefslogtreecommitdiffstats
path: root/ffi/src/net.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ffi/src/net.rs')
-rw-r--r--ffi/src/net.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/ffi/src/net.rs b/ffi/src/net.rs
index 9c462f4e..5ef0353f 100644
--- a/ffi/src/net.rs
+++ b/ffi/src/net.rs
@@ -34,13 +34,15 @@ use std::slice;
extern crate sequoia_openpgp as openpgp;
-use self::openpgp::TPK;
use sequoia_net::KeyServer;
use super::error::Status;
use super::core::Context;
use ::openpgp::keyid::KeyID;
+use ::openpgp::tpk::TPK;
use ::RefRaw;
+use MoveResultIntoRaw;
+use Maybe;
/// Returns a handle for the given URI.
///
@@ -115,13 +117,13 @@ pub extern "system" fn sq_keyserver_free(ks: Option<&mut KeyServer>) {
pub extern "system" fn sq_keyserver_get(ctx: *mut Context,
ks: *mut KeyServer,
id: *const KeyID)
- -> *mut TPK {
+ -> Maybe<TPK> {
let ctx = ffi_param_ref_mut!(ctx);
ffi_make_fry_from_ctx!(ctx);
let ks = ffi_param_ref_mut!(ks);
let id = id.ref_raw();
- ffi_try_box!(ks.get(&id))
+ ks.get(&id).move_into_raw(Some(ctx.errp()))
}
/// Sends the given key to the server.
@@ -135,7 +137,7 @@ pub extern "system" fn sq_keyserver_send(ctx: *mut Context,
let ctx = ffi_param_ref_mut!(ctx);
ffi_make_fry_from_ctx!(ctx);
let ks = ffi_param_ref_mut!(ks);
- let tpk = ffi_param_ref!(tpk);
+ let tpk = tpk.ref_raw();
ffi_try_status!(ks.send(tpk))
}