summaryrefslogtreecommitdiffstats
path: root/vendor/curl/tests/atexit.rs
blob: 0872a4e97c8c27bc17bf7aa3e0620f036ca3b359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use curl::easy::Easy;

pub extern "C" fn hook() {
    let mut easy = Easy::new();
    easy.url("google.com").unwrap();
    easy.write_function(|data| Ok(data.len())).unwrap();
    easy.perform().unwrap();
}

fn main() {
    curl::init();
    hook();
    unsafe {
        libc::atexit(hook);
    }
    println!("Finishing...")
}