From df20de80e115caf9cb52d77bca6be5f53f7be115 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 31 Jan 2019 07:47:47 +0100 Subject: ssl: Add erl_dist_handle to connection_env --- lib/ssl/src/ssl_connection.erl | 5 +++-- lib/ssl/src/ssl_connection.hrl | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 99d429511a..237cd03c0c 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -464,7 +464,7 @@ read_application_data( Data, #state{ user_data_buffer = Buffer0, - erl_dist_handle = DHandle} = State) -> + connection_env = #connection_env{erl_dist_handle = DHandle}} = State) -> %% Buffer = bincat(Buffer0, Data), case DHandle of @@ -1110,12 +1110,13 @@ connection(cast, {internal_renegotiate, WriteState}, #state{static_env = #static connection_states = ConnectionStates#{current_write => WriteState}}, []); connection(cast, {dist_handshake_complete, DHandle}, #state{ssl_options = #ssl_options{erl_dist = true}, + connection_env = CEnv, socket_options = SockOpts} = State0, Connection) -> process_flag(priority, normal), State1 = State0#state{ socket_options = SockOpts#socket_options{active = true}, - erl_dist_handle = DHandle, + connection_env = CEnv#connection_env{erl_dist_handle = DHandle}, bytes_to_read = undefined}, {Record, State} = read_application_data(<<>>, State1), Connection:next_event(connection, Record, State); diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl index f5fc8dde04..21c200271d 100644 --- a/lib/ssl/src/ssl_connection.hrl +++ b/lib/ssl/src/ssl_connection.hrl @@ -76,7 +76,8 @@ user_application :: {Monitor::reference(), User::pid()}, downgrade, terminated = false ::boolean() | closed, - negotiated_version :: ssl_record:ssl_version() | 'undefined' + negotiated_version :: ssl_record:ssl_version() | 'undefined', + erl_dist_handle = undefined :: erlang:dist_handle() | undefined }). -record(state, { @@ -113,7 +114,6 @@ %% The mecahnism is also usefull in TLS although we do not %% need to worry about packet loss in TLS. In DTLS we need to track DTLS handshake seqnr flight_state = reliable, %% reliable | {retransmit, integer()}| {waiting, ref(), integer()} - last two is used in DTLS over udp. - erl_dist_handle = undefined :: erlang:dist_handle() | undefined, protocol_specific = #{} :: map() }). -- cgit v1.2.3