Skip to content

Commit

Permalink
refactor(curl): remove pointless string passing
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: c92f8d4e-8e49-41da-b724-06c497c8a823 -->
  • Loading branch information
rgrinberg committed Jun 25, 2024
1 parent eec14ff commit 876bc8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 876bc8f

Please sign in to comment.