mirror of
https://github.com/c-cube/ezcurl.git
synced 2025-12-05 19:00:34 -05:00
Merge 48b3330b95 into 742e51df97
This commit is contained in:
commit
36ff811276
2 changed files with 19 additions and 0 deletions
|
|
@ -97,6 +97,21 @@ let make ?(set_opts = fun _ -> ()) ?cookiejar_file
|
|||
|
||||
let delete (self : t) = Curl.cleanup self.curl
|
||||
|
||||
let _cfg_mutex = Mutex.create ()
|
||||
let _cfg_no_signal = ref None
|
||||
|
||||
let _get_no_signal () =
|
||||
Mutex.lock _cfg_mutex;
|
||||
let v = !_cfg_no_signal in
|
||||
Mutex.unlock _cfg_mutex;
|
||||
v
|
||||
|
||||
let set_no_signal v =
|
||||
Mutex.lock _cfg_mutex;
|
||||
_cfg_no_signal := Some v;
|
||||
Mutex.unlock _cfg_mutex;
|
||||
()
|
||||
|
||||
module Cookies = struct
|
||||
let reload_cookiejar (self : t) : unit =
|
||||
Curl.set_cookielist self.curl "RELOAD"
|
||||
|
|
@ -131,6 +146,7 @@ let _apply_config (self : t) (config : Config.t) : unit =
|
|||
opt_iter authmethod ~f:(Curl.set_httpauth self.curl);
|
||||
opt_iter username ~f:(Curl.set_username self.curl);
|
||||
opt_iter password ~f:(Curl.set_password self.curl);
|
||||
opt_iter (_get_no_signal ()) ~f:(Curl.set_nosignal self);
|
||||
()
|
||||
|
||||
let _set_headers (self : t) (headers : _ list) : unit =
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ val delete : t -> unit
|
|||
val with_client : ?set_opts:(Curl.t -> unit) -> (t -> 'a) -> 'a
|
||||
(** Make a temporary client, call the function with it, then cleanup. *)
|
||||
|
||||
val set_no_signal : bool -> unit
|
||||
(** Set no_signal default value for each new client instance *)
|
||||
|
||||
(** Cookie handling.
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue