From 7a9037b9f796912cce1b04910fcf90b3e474f612 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 17 Nov 2017 11:31:08 +0100 Subject: ssl: Use genstamtem properly --- lib/ssl/src/ssl_connection.erl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/ssl/src/ssl_connection.erl') diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 1f77b558ef..1d54a2793c 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -61,14 +61,11 @@ %% General gen_statem state functions with extra callback argument %% to determine if it is an SSL/TLS or DTLS gen_statem machine --export([init/4, hello/4, abbreviated/4, certify/4, cipher/4, connection/4, downgrade/4]). +-export([init/4, error/4, hello/4, abbreviated/4, certify/4, cipher/4, connection/4, downgrade/4]). %% gen_statem callbacks -export([terminate/3, format_status/2]). -%% TODO: do not export, call state function instead --export([handle_info/3, handle_call/5, handle_common_event/5]). - %%==================================================================== %% Setup %%==================================================================== @@ -538,6 +535,15 @@ init({call, From}, Msg, State, Connection) -> init(_Type, _Event, _State, _Connection) -> {keep_state_and_data, [postpone]}. +%%-------------------------------------------------------------------- +-spec error(gen_statem:event_type(), + {start, timeout()} | term(), #state{}, + tls_connection | dtls_connection) -> + gen_statem:state_function_result(). +%%-------------------------------------------------------------------- +error({call, From}, Msg, State, Connection) -> + handle_call(Msg, From, ?FUNCTION_NAME, State, Connection). + %%-------------------------------------------------------------------- -spec hello(gen_statem:event_type(), #hello_request{} | #server_hello{} | term(), -- cgit v1.2.3