diff options
author | Ingela Anderton Andin <[email protected]> | 2018-07-11 10:05:38 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2018-07-11 10:05:38 +0200 |
commit | e7cd3ad8224e4a755169176e0420d1b77c814272 (patch) | |
tree | d7562b719e2fcc953bc3253b8548637bff689cae /lib/ssl/src/tls_connection.erl | |
parent | e36538a04a4b78bde04e08141b295213b970aa2c (diff) | |
parent | 0da48905b544052287c42ced84b4a2274ae56d84 (diff) | |
download | otp-e7cd3ad8224e4a755169176e0420d1b77c814272.tar.gz otp-e7cd3ad8224e4a755169176e0420d1b77c814272.tar.bz2 otp-e7cd3ad8224e4a755169176e0420d1b77c814272.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 47779c3450..1a0a9b9275 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -112,12 +112,13 @@ start_link(Role, Host, Port, Socket, Options, User, CbInfo) -> init([Role, Host, Port, Socket, Options, User, CbInfo]) -> process_flag(trap_exit, true), - State0 = initial_state(Role, Host, Port, Socket, Options, User, CbInfo), + State0 = #state{protocol_specific = Map} = initial_state(Role, Host, Port, Socket, Options, User, CbInfo), try State = ssl_connection:ssl_config(State0#state.ssl_options, Role, State0), gen_statem:enter_loop(?MODULE, [], init, State) catch throw:Error -> - gen_statem:enter_loop(?MODULE, [], error, {Error, State0}) + EState = State0#state{protocol_specific = Map#{error => Error}}, + gen_statem:enter_loop(?MODULE, [], error, EState) end. %%==================================================================== %% State transition handling @@ -463,17 +464,12 @@ init(Type, Event, State) -> {start, timeout()} | term(), #state{}) -> gen_statem:state_function_result(). %%-------------------------------------------------------------------- - -error({call, From}, {start, _Timeout}, {Error, State}) -> - ssl_connection:stop_and_reply( - normal, {reply, From, {error, Error}}, State); error({call, From}, {start, _Timeout}, #state{protocol_specific = #{error := Error}} = State) -> ssl_connection:stop_and_reply( normal, {reply, From, {error, Error}}, State); -error({call, _} = Call, Msg, {Error, #state{protocol_specific = Map} = State}) -> - gen_handshake(?FUNCTION_NAME, Call, Msg, - State#state{protocol_specific = Map#{error => Error}}); +error({call, _} = Call, Msg, State) -> + gen_handshake(?FUNCTION_NAME, Call, Msg, State); error(_, _, _) -> {keep_state_and_data, [postpone]}. |