Commit 0ca71a98 authored by Steven Fackler's avatar Steven Fackler
Browse files

Clean up init stuff

parent 201624a3
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -252,10 +252,10 @@ extern fn locking_function(mode: c_int, n: c_int, _file: *const c_char,
}

pub fn init() {
    static mut INIT: Once = ONCE_INIT;
    static INIT: Once = ONCE_INIT;

    unsafe {
    INIT.call_once(|| {
        unsafe {
            SSL_library_init();
            SSL_load_error_strings();

@@ -270,9 +270,9 @@ pub fn init() {
            GUARDS = mem::transmute(guards);

            CRYPTO_set_locking_callback(locking_function);
            unsafe{ rust_openssl_set_id_callback(); }
        })
            rust_openssl_set_id_callback();
        }
    })
}

pub unsafe fn SSL_CTX_set_options(ssl: *mut SSL_CTX, op: u64) -> u64 {
+2 −3
Original line number Diff line number Diff line
@@ -10,12 +10,11 @@

unsigned long thread_id()
{
    unsigned long ret = (unsigned long)pthread_self();
    return ret;
    return (unsigned long) pthread_self();
}

void rust_openssl_set_id_callback() {
  CRYPTO_set_id_callback((unsigned long (*)())thread_id);
  CRYPTO_set_id_callback(thread_id);
}

#else