1 (* Copyright (c) 2013, Thomas Leonard, <talex5@gmail.com> *)
9 let connection = init
() in
10 let error_buffer = ref "" in
12 set_writefunction
connection (fun _
-> raise Abort
);
13 set_url
connection "http://google.com";
14 set_errorbuffer
connection error_buffer;
20 | CurlException
(CURLE_WRITE_ERROR
,_
,_
) -> printf
"ok\n%!"
21 | CurlException
(error
,_
,name
) -> printf
"E: wrong error: %s %s : %s\n%!" name
(Curl.strerror error
) !error_buffer
22 | exn
-> printf
"E: wrong error: %s\n%!" (Printexc.to_string exn
)