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/dtls_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/dtls_connection.erl')
-rw-r--r-- | lib/ssl/src/dtls_connection.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index 9596fe25c8..c0e81d6a28 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -92,13 +92,14 @@ 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 @@ -471,7 +472,8 @@ init(Type, Event, State) -> %%-------------------------------------------------------------------- error(enter, _, State) -> {keep_state, State}; -error({call, From}, {start, _Timeout}, {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, State) -> |