diff options
author | Loïc Hoguin <[email protected]> | 2023-12-21 14:49:50 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2023-12-21 14:49:50 +0100 |
commit | 14b96873cf3a9afedeb11f087c5d49f2139665a4 (patch) | |
tree | c98b6fb96bdf975595e2850c144cd88ea91f09ef | |
parent | 040151ff7063747496020558c593f95f43408de2 (diff) | |
download | ct_helper-14b96873cf3a9afedeb11f087c5d49f2139665a4.tar.gz ct_helper-14b96873cf3a9afedeb11f087c5d49f2139665a4.tar.bz2 ct_helper-14b96873cf3a9afedeb11f087c5d49f2139665a4.zip |
Export get_remote_pid_tls_state/1
-rw-r--r-- | src/ct_helper.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl index 3ef850f..5659f47 100644 --- a/src/ct_helper.erl +++ b/src/ct_helper.erl @@ -24,6 +24,7 @@ -export([get_parent_pid/1]). -export([get_remote_pid_tcp/1]). -export([get_remote_pid_tls/1]). +-export([get_remote_pid_tls_state/1]). -export([ignore/3]). -export([is_process_down/1]). -export([is_process_down/2]). @@ -145,28 +146,28 @@ get_remote_pid_tls(Socket) -> %% This gives us the pid of the sslsocket process. %% We must introspect this process in order to retrieve the connection pid. TLSPid = get_remote_pid_tcp(ssl:sockname(Socket)), - get_tls_state(TLSPid). + get_remote_pid_tls_state(TLSPid). -ifdef(OTP_RELEASE). -if(?OTP_RELEASE >= 22). -get_tls_state(TLSPid) -> +get_remote_pid_tls_state(TLSPid) -> {_, #state{connection_env=ConnEnv}} = sys:get_state(TLSPid), {_, UserPid} = element(2, ConnEnv), %% #connection_env.user_application UserPid. -else. %% This is defined in ssl_record.hrl starting from OTP-21.3. -ifdef(KNOWN_RECORD_TYPE). -get_tls_state(TLSPid) -> +get_remote_pid_tls_state(TLSPid) -> {_, #state{connection_env=#connection_env{user_application={_, UserPid}}}} = sys:get_state(TLSPid), UserPid. -else. -get_tls_state(TLSPid) -> +get_remote_pid_tls_state(TLSPid) -> {_, #state{user_application={_, UserPid}}} = sys:get_state(TLSPid), UserPid. -endif. -endif. -else. -get_tls_state(TLSPid) -> +get_remote_pid_tls_state(TLSPid) -> {_, #state{user_application={_, UserPid}}} = sys:get_state(TLSPid), UserPid. -endif. |