mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
lots more refactoring
This commit is contained in:
parent
87fdd644d4
commit
5f548705dd
3 changed files with 256 additions and 201 deletions
|
@ -72,6 +72,16 @@ pub extern "C" fn zeroidc_stop(ptr: *mut ZeroIDC) {
|
|||
idc.stop();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn zeroidc_is_running(ptr: *mut ZeroIDC) -> bool {
|
||||
let idc = unsafe {
|
||||
assert!(!ptr.is_null());
|
||||
&mut *ptr
|
||||
};
|
||||
|
||||
idc.is_running()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn zeroidc_get_auth_info(
|
||||
ptr: *mut ZeroIDC,
|
||||
|
|
|
@ -117,6 +117,16 @@ impl ZeroIDC {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_running(&mut self) -> bool {
|
||||
let local = Arc::clone(&self.inner);
|
||||
|
||||
if (*local.lock().unwrap()).running {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn get_auth_info(&mut self, csrf_token: String, nonce: String) -> Option<AuthInfo> {
|
||||
let (pkce_challenge, pkce_verifier) = PkceCodeChallenge::new_random_sha256();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue