in neqo-crypto/src/result.rs [36:52]
fn result_helper(rv: ssl::SECStatus, allow_blocked: bool) -> Res<bool> {
if rv == ssl::_SECStatus_SECSuccess {
return Ok(false);
}
let code = unsafe { PR_GetError() };
if allow_blocked && code == nspr::PR_WOULD_BLOCK_ERROR {
return Ok(true);
}
let name = wrap_str_fn(|| unsafe { PR_ErrorToName(code) }, "UNKNOWN_ERROR");
let desc = wrap_str_fn(
|| unsafe { PR_ErrorToString(code, PR_LANGUAGE_I_DEFAULT) },
"...",
);
Err(Error::NssError { name, code, desc })
}