summaryrefslogtreecommitdiff
path: root/src/session.rs
diff options
context:
space:
mode:
authorWez Furlong <wez@wezfurlong.org>2019-08-01 12:45:31 -0700
committerWez Furlong <wez@wezfurlong.org>2019-08-01 12:45:31 -0700
commitc49581f85ad9c3ad0e5b7595f5c7d6e72ea9a61b (patch)
tree1143f49ddaef05542829266a5e61eb80c445e428 /src/session.rs
parent672893d6f8ff3fec22f7f509247adeb477aa5f4a (diff)
downloadssh2-rs-c49581f85ad9c3ad0e5b7595f5c7d6e72ea9a61b.zip
ignore the panic result from the keyboard prompt
There's not a lot we can do about it.
Diffstat (limited to 'src/session.rs')
-rw-r--r--src/session.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/session.rs b/src/session.rs
index cd33327..a8e5dc3 100644
--- a/src/session.rs
+++ b/src/session.rs
@@ -311,7 +311,10 @@ impl Session {
abstrakt: *mut *mut c_void,
) {
use std::panic::{catch_unwind, AssertUnwindSafe};
- catch_unwind(AssertUnwindSafe(|| {
+ // Catch panics; we can't let them unwind to C code.
+ // There's not much to be done with them though because the
+ // signature of the callback doesn't allow reporting an error.
+ let _ = catch_unwind(AssertUnwindSafe(|| {
let prompter = unsafe { &mut **(abstrakt as *mut *mut P) };
let username =