Skip to content

Commit 6d91109

Browse files
committed
CA-403620: Drop the with_client_proxy
Signed-off-by: Ming Lu <[email protected]>
1 parent 01d079e commit 6d91109

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

ocaml/libs/stunnel/stunnel.ml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -448,45 +448,6 @@ let with_connect ?unique_id ?use_fork_exec_helper ?write_to_log ~verify_cert
448448
)
449449
5
450450
451-
let with_client_proxy ~verify_cert ~remote_host ~remote_port ~local_host
452-
~local_port f =
453-
( try
454-
D.debug "Clean up running stunnel client proxy if there is any ..." ;
455-
let out, _ =
456-
Forkhelpers.execute_command_get_output "/usr/sbin/fuser"
457-
["-4k"; string_of_int local_port ^ "/tcp"]
458-
in
459-
D.debug "Killed running stunnel client proxy:%s" out
460-
with
461-
| Forkhelpers.Spawn_internal_error (stderr, stdout, process_status) -> (
462-
match process_status with
463-
| Unix.WEXITED 1 ->
464-
D.debug "No running stunnel client proxy"
465-
| _ ->
466-
D.warn
467-
"Cleaning up running stunnel client proxy returned unexpectedly: \
468-
stdout=(%s); stderr=(%s)"
469-
stdout stderr
470-
)
471-
) ;
472-
473-
retry
474-
(fun () ->
475-
let pid, _ =
476-
attempt_one_connect
477-
(`Local_host_port (local_host, local_port))
478-
verify_cert remote_host remote_port
479-
in
480-
D.debug "Started a client proxy (pid:%s): %s:%s -> %s:%s"
481-
(string_of_int (getpid pid))
482-
local_host (string_of_int local_port) remote_host
483-
(string_of_int remote_port) ;
484-
Xapi_stdext_pervasives.Pervasiveext.finally
485-
(fun () -> f ())
486-
(fun () -> disconnect_with_pid ~wait:false ~force:true pid)
487-
)
488-
5
489-
490451
let with_client_proxy_systemd_service ~verify_cert ~remote_host ~remote_port
491452
~local_host ~local_port ~service f =
492453
let cmd_path = stunnel_path () in

ocaml/libs/stunnel/stunnel.mli

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ val with_moved_exn : t -> (t -> 'd) -> 'd
8888

8989
val safe_release : t -> unit
9090

91-
val with_client_proxy :
92-
verify_cert:verification_config option
93-
-> remote_host:string
94-
-> remote_port:int
95-
-> local_host:string
96-
-> local_port:int
97-
-> (unit -> 'a)
98-
-> 'a
99-
10091
val with_client_proxy_systemd_service :
10192
verify_cert:verification_config option
10293
-> remote_host:string

0 commit comments

Comments
 (0)