fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38792?usp=email )
Change subject: sctp_proxy: add all-state event handler ......................................................................
sctp_proxy: add all-state event handler
This patch prepares for a follow-up commit adding a request (fetch_info) that must be handled in any state.
Change-Id: I7b6acba7dd367fa28db8922a38ac10c00bd479fe --- M src/sctp_proxy.erl 1 file changed, 7 insertions(+), 5 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve
diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index fc33f70..b23451f 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -144,8 +144,7 @@ {keep_state, S};
connecting(Event, EventData, S) -> - ?LOG_ERROR("Unexpected event ~p: ~p", [Event, EventData]), - {keep_state, S}. + handle_event(?FUNCTION_NAME, Event, EventData, S).
%% CONNECTED state @@ -198,12 +197,15 @@ [MmeAddr, MmePort, AncData, Data]), {keep_state, S};
-%% Catch-all handler for this state connected(Event, EventData, S) -> - ?LOG_ERROR("Unexpected event ~p: ~p", [Event, EventData]), - {keep_state, S}. + handle_event(?FUNCTION_NAME, Event, EventData, S).
+%% Event handler for all states +handle_event(State, Event, EventData, _S) -> + ?LOG_ERROR("Unexpected event ~p in state ~p: ~p", [Event, State, EventData]), + {keep_state_and_data}. +
code_change(_Vsn, State, S, _Extra) -> {ok, State, S}.