Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(curl): remove pointless string passing #1047

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cohttp-curl-async/src/cohttp_curl_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Context = struct
timeout = None;
}
in
let rec finished s =
let rec finished () =
match Curl.Multi.remove_finished t.mt with
| None -> ()
| Some (h, code) ->
Expand All @@ -41,19 +41,19 @@ module Context = struct
| Some w ->
Hashtbl.remove t.wakeners h;
Ivar.fill_exn w code);
finished s
finished ()
in
let on_readable fd =
let (_ : int) = Curl.Multi.action t.mt (Fd.file_descr_exn fd) EV_IN in
finished "on_readable"
finished ()
in
let on_writable fd =
let (_ : int) = Curl.Multi.action t.mt (Fd.file_descr_exn fd) EV_OUT in
finished "on_writable"
finished ()
in
let on_timer () =
Curl.Multi.action_timeout t.mt;
finished "on_timer"
finished ()
in
Curl.Multi.set_timer_function t.mt (fun timeout ->
(match t.timeout with
Expand Down
10 changes: 5 additions & 5 deletions cohttp-curl-lwt/src/cohttp_curl_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Context = struct
timer_event = Lwt_engine.fake_event;
}
in
let rec finished s =
let rec finished () =
match Curl.Multi.remove_finished t.mt with
| None -> ()
| Some (h, code) ->
Expand All @@ -53,20 +53,20 @@ module Context = struct
| Some w ->
Hashtbl.remove t.wakeners h;
Lwt.wakeup w code);
finished s
finished ()
in
let on_readable fd _ =
let (_ : int) = Curl.Multi.action t.mt fd EV_IN in
finished "on_readable"
finished ()
in
let on_writable fd _ =
let (_ : int) = Curl.Multi.action t.mt fd EV_OUT in
finished "on_writable"
finished ()
in
let on_timer _ =
Lwt_engine.stop_event t.timer_event;
Curl.Multi.action_timeout t.mt;
finished "on_timer"
finished ()
in
Curl.Multi.set_timer_function t.mt (fun timeout ->
Lwt_engine.stop_event t.timer_event;
Expand Down
Loading