From 0f2b77e11dbb2bad37722785a21172d2706d21f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Fri, 10 May 2024 17:15:13 +0100 Subject: [PATCH] CP-47536: drop Unix.select in newcli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup of this commit: 14fd0c98ef ("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 --- ocaml/xe-cli/newcli.ml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ocaml/xe-cli/newcli.ml b/ocaml/xe-cli/newcli.ml index 0e75dbbc877..50367aee11a 100644 --- a/ocaml/xe-cli/newcli.ml +++ b/ocaml/xe-cli/newcli.ml @@ -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 ;