From 6e552fab66b6f706cdeeba9b391327fda386259e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 3 Apr 2023 10:58:14 +0200 Subject: 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). --- src/ct_helper.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3