aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2017-09-27 11:44:19 +0200
committerRaimo Niskanen <[email protected]>2017-09-27 11:44:19 +0200
commit0a0f28747f6765103f160b75f5114be866ed28ce (patch)
tree49e48fe409dfc074e00983fce8a853bea9350cc4 /lib/ssl/src/ssl_connection.erl
parent80103ef6d8e1dd2f3be1ec33924c74f4f9362301 (diff)
downloadotp-0a0f28747f6765103f160b75f5114be866ed28ce.tar.gz
otp-0a0f28747f6765103f160b75f5114be866ed28ce.tar.bz2
otp-0a0f28747f6765103f160b75f5114be866ed28ce.zip
Pass all info's to the ssl_connection state function
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r--lib/ssl/src/ssl_connection.erl43
1 files changed, 22 insertions, 21 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 008e7e1704..dd62ccddcd 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -829,6 +829,26 @@ connection(
end;
connection({call, From}, Msg, State, Connection) ->
handle_call(Msg, From, connection, State, Connection);
+connection(
+ info, dist_data = Msg,
+ #state{
+ ssl_options = #ssl_options{erl_dist = true},
+ protocol_specific = #{d_handle := DHandle}} = State,
+ _) ->
+ eat_msgs(Msg),
+ try send_dist_data(connection, State, DHandle, [])
+ catch _:Reason ->
+ death_row(State, Reason)
+ end;
+connection(
+ info, tick = Msg,
+ #state{
+ ssl_options = #ssl_options{erl_dist = true},
+ protocol_specific = #{d_handle := _}},
+ _) ->
+ eat_msgs(Msg),
+ {keep_state_and_data,
+ [{next_event, {call, {self(), undefined}}, {application_data, <<>>}}]};
connection(info, Msg, State, _) ->
handle_info(Msg, connection, State);
connection(internal, {recv, _}, State, Connection) ->
@@ -1080,32 +1100,13 @@ handle_info({cancel_start_or_recv, RecvFrom}, StateName,
handle_info({cancel_start_or_recv, _RecvFrom}, StateName, State) ->
{next_state, StateName, State#state{timer = undefined}};
-handle_info(
- dist_data = Msg,
- connection,
- #state{
- ssl_options = #ssl_options{erl_dist = true},
- protocol_specific = #{d_handle := DHandle}} = State) ->
- eat_msgs(Msg),
- try send_dist_data(connection, State, DHandle, [])
- catch _:Reason ->
- death_row(State, Reason)
- end;
-handle_info(
- tick = Msg,
- connection,
- #state{
- ssl_options = #ssl_options{erl_dist = true},
- protocol_specific = #{d_handle := _}}) ->
- eat_msgs(Msg),
- {keep_state_and_data,
- [{next_event, {call, {self(), undefined}}, {application_data, <<>>}}]};
-
handle_info(Msg, StateName, #state{socket = Socket, error_tag = Tag} = State) ->
Report = io_lib:format("SSL: Got unexpected info: ~p ~n", [{Msg, Tag, Socket}]),
error_logger:info_report(Report),
{next_state, StateName, State}.
+
+
send_dist_data(StateName, State, DHandle, Acc) ->
case erlang:dist_ctrl_get_data(DHandle) of
none ->