summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2023-04-03 10:58:14 +0200
committerLoïc Hoguin <[email protected]>2023-04-03 10:58:14 +0200
commit6e552fab66b6f706cdeeba9b391327fda386259e (patch)
treebc4b80dd92718a3c548e18115ff534ec558572a5
parentf6bf4586bb856f9e63d6ec00340bc37eab1d2be9 (diff)
downloadct_helper-6e552fab66b6f706cdeeba9b391327fda386259e.tar.gz
ct_helper-6e552fab66b6f706cdeeba9b391327fda386259e.tar.bz2
ct_helper-6e552fab66b6f706cdeeba9b391327fda386259e.zip
Fix get_tls_state/1 for OTP-24.1+
The connection_env changed and added a field. The fixed function will continue working as long as user_application is the first field in the record (second in the tuple).
-rw-r--r--src/ct_helper.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl
index 6e6371c..c1a1d93 100644
--- a/src/ct_helper.erl
+++ b/src/ct_helper.erl
@@ -150,7 +150,8 @@ get_remote_pid_tls(Socket) ->
-ifdef(OTP_RELEASE).
-if(?OTP_RELEASE >= 22).
get_tls_state(TLSPid) ->
- {_, #state{connection_env=#connection_env{user_application={_, UserPid}}}} = sys:get_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.