Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
ct_helper
ct_helper-ssl_connection-state.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ct_helper-ssl_connection-state.patch of Package ct_helper
diff -Ndurp ct_helper/src/ct_helper.erl ct_helper-ssl_connection-state/src/ct_helper.erl --- ct_helper/src/ct_helper.erl 2019-10-17 16:32:34.000000000 +0300 +++ ct_helper-ssl_connection-state/src/ct_helper.erl 2019-11-05 00:36:22.973361477 +0200 @@ -36,7 +36,7 @@ -type key() :: {'RSAPrivateKey' | 'DSAPrivateKey' | 'PrivateKeyInfo', der_encoded()}. --include_lib("ssl/src/ssl_connection.hrl"). +-include_lib("public_key/include/OTP-PUB-KEY.hrl"). %% @doc List all test cases in the suite. %% @@ -146,28 +146,17 @@ get_remote_pid_tls(Socket) -> TLSPid = get_remote_pid_tcp(ssl:sockname(Socket)), get_tls_state(TLSPid). --ifdef(OTP_RELEASE). --if(?OTP_RELEASE >= 22). get_tls_state(TLSPid) -> - {_, #state{connection_env=#connection_env{user_application={_, UserPid}}}} = sys:get_state(TLSPid), - UserPid. --else. -%% This is defined in ssl_record.hrl starting from OTP-21.3. --ifdef(KNOWN_RECORD_TYPE). -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. --endif. --else. -get_tls_state(TLSPid) -> - {_, #state{user_application={_, UserPid}}} = sys:get_state(TLSPid), - UserPid. --endif. + {_, State} = sys:get_state(TLSPid), + case tuple_to_list(State) of + [state, Role, {_, UserPid}|_] when is_atom(Role) -> + UserPid; + %% Starting from OTP-21.3 + [state, StaticEnv, ConnectionEnv|_] when element(1, StaticEnv) =:= static_env, + element(1, ConnectionEnv) =:= connection_env -> + {_, UserPid} = element(2, ConnectionEnv), + UserPid + end. %% @doc Ignore crashes from Pid occuring in M:F/A.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor