summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-03-10 10:26:50 +0100
committerLoïc Hoguin <[email protected]>2019-03-10 10:26:50 +0100
commitbdf7e746f05112f4cc6dfea0fc59ec5a55797b28 (patch)
treeaebb4f0b4dc27feda5726096c7d850d0c52e30c5
parent8c69a0ddd9a11c634c86bf3ce59459c93ff211fc (diff)
downloadct_helper-bdf7e746f05112f4cc6dfea0fc59ec5a55797b28.tar.gz
ct_helper-bdf7e746f05112f4cc6dfea0fc59ec5a55797b28.tar.bz2
ct_helper-bdf7e746f05112f4cc6dfea0fc59ec5a55797b28.zip
Fix get_remote_pid_tls for OTP-22+
-rw-r--r--src/ct_helper.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl
index 73dd96a..58fff09 100644
--- a/src/ct_helper.erl
+++ b/src/ct_helper.erl
@@ -142,8 +142,17 @@ 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).
+
+-if(?OTP_RELEASE >= 22).
+get_tls_state(TLSPid) ->
+ {_, #state{connection_env=#connection_env{user_application={_, UserPid}}}} = sys:get_state(TLSPid),
+ UserPid.
+-else.
+get_tls_state(TLSPid) ->
{_, #state{user_application={_, UserPid}}} = sys:get_state(TLSPid),
UserPid.
+-endif.
%% @doc Ignore crashes from Pid occuring in M:F/A.