fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37218?usp=email )


Change subject: sctp_server: fix state in catch-all handle_call()
......................................................................

sctp_server: fix state in catch-all handle_call()

Sending an unexpected call breaks the server, because the third member
of a returned tuple (not_implemented) becomes the new state.  It was
actually meant to be part of the Reply - fix this.

https://www.erlang.org/doc/apps/stdlib/gen_server.html#c:handle_call/3

  {reply, Reply :: term(), NewState :: term()}

Change-Id: I1cc683e549c3bb61e3e4c45bb3d244202d61be53
---
M src/sctp_server.erl
1 file changed, 18 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw 
refs/changes/18/37218/1

diff --git a/src/sctp_server.erl b/src/sctp_server.erl
index e93dd9f..806c559 100644
--- a/src/sctp_server.erl
+++ b/src/sctp_server.erl
@@ -95,7 +95,7 @@
 handle_call(Info, _From, State) ->
     error_logger:error_report(["unknown handle_call()",
                                {module, ?MODULE}, {info, Info}, {state, 
State}]),
-    {reply, error, not_implemented}.
+    {reply, {error, not_implemented}, State}.


 handle_cast({send_data, Aid, Data}, State) ->

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37218?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I1cc683e549c3bb61e3e4c45bb3d244202d61be53
Gerrit-Change-Number: 37218
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to