Skip to content

Commit

Permalink
CP-47536: drop Unix.select in newcli
Browse files Browse the repository at this point in the history
This is a followup of this commit:
14fd0c9 ("CA-226177: Fix premature termination of cli")

That commit dropped the active monitoring of stunnel processes,
but kept the while-select loop.
That loop serves no purpose now, we can instead do a blocking Unix.read directly,
and get woken up when a packet arrives (this is the the single-threaded CLI, not the CLI server).

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed May 13, 2024
1 parent 76b477e commit 31ba3d4
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions ocaml/xe-cli/newcli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,6 @@ let main_loop ifd ofd permitted_filenames =
marshal_protocol ofd ;
let exit_code = ref None in
while !exit_code = None do
(* Wait for input asynchronously so that we can check the status
of Stunnel every now and then, for better debug/dignosis.
*)
while
match Unix.select [ifd] [] [] 5.0 with _ :: _, _, _ -> false | _ -> true
do
()
done ;
let cmd = try unmarshal ifd with e -> handle_unmarshal_failure e ifd in
debug "Read: %s\n%!" (string_of_message cmd) ;
flush stderr ;
Expand Down

0 comments on commit 31ba3d4

Please sign in to comment.