lcg 1.7.1

This commit is contained in:
Dan Ballard 2022-04-21 17:07:51 -07:00
parent 14e6010574
commit d00f8bbee4
5 changed files with 11 additions and 3 deletions

View File

@ -15,9 +15,9 @@ fn main() {
println!("cargo:rerun-if-changed=libCwtch.h"); println!("cargo:rerun-if-changed=libCwtch.h");
let lib_cwtch_path = Path::new(&out_dir).join("libCwtch.so"); let lib_cwtch_path = Path::new(&out_dir).join("libCwtch.so");
// https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases v1.7.0 // https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases v1.7.1
Command::new("wget") Command::new("wget")
.arg("https://git.openprivacy.ca/attachments/390d383b-ab02-489b-b5c9-e62267d8b3fd") .arg("https://git.openprivacy.ca/attachments/98184e9c-1dc7-431a-9601-91a9e763e8fc")
.arg("-O") .arg("-O")
.arg(lib_cwtch_path) .arg(lib_cwtch_path)
.output() .output()
@ -29,5 +29,5 @@ fn main() {
io::copy(&mut file, &mut hasher).expect("failed to copy file into hasher"); io::copy(&mut file, &mut hasher).expect("failed to copy file into hasher");
let hash_bytes = hasher.finalize(); let hash_bytes = hasher.finalize();
assert_eq!(hash_bytes[..], hex!("271c281bad59696fc4ea5e559b5d3fe5c1949384c26dd891dde91b0af0a012e30bdbc3b16781ec5de795d2945e2f42415a8985451b49394b3c85c412ab4769d3")[..]); assert_eq!(hash_bytes[..], hex!("cb4368d72a46f8046261c50e6e9ecf170d8e606871d5de2c1e9e34303533c344f92f5d946d7e12614581dfa3ae8e638512af7f4623ed91b1ceb1570de14bf192")[..]);
} }

View File

@ -122,6 +122,7 @@ extern void c_StopServer(char* onionPtr, int onionLen);
extern void c_StopServers(); extern void c_StopServers();
extern void c_DestroyServers(); extern void c_DestroyServers();
extern void c_SetServerAttribute(char* onionPtr, int onionLen, char* keyPtr, int keyLen, char* valPtr, int valLen); extern void c_SetServerAttribute(char* onionPtr, int onionLen, char* keyPtr, int keyLen, char* valPtr, int valLen);
extern char* c_GetDebugInfo();
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -163,4 +163,5 @@ impl CwtchLib for CwtchLibGo {
c_bind!(stop_servers(;;) c_StopServers); c_bind!(stop_servers(;;) c_StopServers);
c_bind!(destroy_servers(;;) c_DestroyServers); c_bind!(destroy_servers(;;) c_DestroyServers);
c_bind!(set_server_attribute(onion: &str, key: &str, val: &str;;) c_SetServerAttribute); c_bind!(set_server_attribute(onion: &str, key: &str, val: &str;;) c_SetServerAttribute);
c_bind!(get_debug_info(;;) c_GetDebugInfo -> String);
} }

View File

@ -529,3 +529,6 @@ extern "C" {
valLen: ::std::os::raw::c_int, valLen: ::std::os::raw::c_int,
); );
} }
extern "C" {
pub fn c_GetDebugInfo() -> *mut ::std::os::raw::c_char;
}

View File

@ -167,6 +167,9 @@ pub trait CwtchLib {
/// Set the specified server's attribute of key to val /// Set the specified server's attribute of key to val
fn set_server_attribute(&self, onion: &str, key: &str, val: &str); fn set_server_attribute(&self, onion: &str, key: &str, val: &str);
/// Get debug info (mem, goroutine stats) from lcg in json
fn get_debug_info(&self) -> String;
} }
/// Create a new CwtchLib that is backed by bindings to libcwtch-go /// Create a new CwtchLib that is backed by bindings to libcwtch-go