reset easy handle before use

One thing this does is reset the request method to the default, which
otherwise would be stuck at any request method previously set with
Curl.set_customrequest
This commit is contained in:
Christopher Zimmermann 2026-02-08 21:10:48 -05:00 committed by Simon Cruanes
parent 0c4e9f30e1
commit 1c489f0097

View file

@ -399,7 +399,9 @@ module Make (IO : IO) : S with type 'a io = 'a IO.t = struct
let do_cleanup, self =
match client with
| None -> true, make ()
| Some c -> false, c
| Some c ->
Curl.reset c.curl;
false, c
in
_apply_config self config;
opt_iter range ~f:(fun s -> Curl.set_range self.curl s);