5 let s1 = String.make size 'd'
in
7 let s2 = String.make size 'c'
in
8 set_httppost
h [CURLFORM_CONTENT
("part", s2, DEFAULT
)];
9 assert (get_private
h = s1);
14 let s = String.make size 'a'
in
15 set_mimepost
h [{encoding
=CURLMIME_BINARY
;headers
=[];subparts
=[];data
=CURLMIME_DATA
s}];
16 (* doesn't work, see https://github.com/curl/curl/issues/2551 *)
17 (* let g = duphandle h in *)
23 let path = Printf.sprintf
"/proc/%d/statm" (Unix.getpid
()) in
25 let ch = open_in
path in
26 let n = Scanf.fscanf
ch "%_d %d" (fun x
-> 4*1024*x
) in close_in_noerr
ch; n
27 with exn
-> Printf.eprintf
"Error opening %s (%s), ignoring\n%!" path (Printexc.to_string exn
); 0
29 let check test count leak_size
=
32 for i
= 0 to pred count
do
37 Printf.printf
"RSS %d -> %d %s\n%!" rss1 rss2 (if rss2 - rss1 < count
* leak_size
/ 10 then "OK" else "LEAKING")
39 Curl.NotImplemented
s -> Printf.printf
"skipping test : libcurl doesn't provide %s\n%!" s
42 let mb = 1024 * 1024 in