aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2014-05-24 10:56:22 +0200
committerAnders Svensson <[email protected]>2014-05-26 13:52:05 +0200
commit11e3a1b7f21fbb4419043b36ea9cf8c2d53aa7b5 (patch)
tree6fcd73db66052c521e959501f873d69cf1dc1923
parent6ff5384c118a3382823a99ccbb5b82d68c7a8e74 (diff)
downloadotp-11e3a1b7f21fbb4419043b36ea9cf8c2d53aa7b5.tar.gz
otp-11e3a1b7f21fbb4419043b36ea9cf8c2d53aa7b5.tar.bz2
otp-11e3a1b7f21fbb4419043b36ea9cf8c2d53aa7b5.zip
Make example server answer unsupported requests with 3001
As it should. The previous discard (surely) pre-dated being able to return {answer_message, 3001} from a handle_request callback.
-rw-r--r--lib/diameter/examples/code/server_cb.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/diameter/examples/code/server_cb.erl b/lib/diameter/examples/code/server_cb.erl
index 68901099e3..76d922c112 100644
--- a/lib/diameter/examples/code/server_cb.erl
+++ b/lib/diameter/examples/code/server_cb.erl
@@ -88,16 +88,15 @@ handle_request(#diameter_packet{msg = Req}, _SvcName, {_, Caps})
{reply, Ans};
-%% Should really reply to other base messages that we don't support
-%% but simply discard them instead.
-handle_request(#diameter_packet{}, _SvcName, {_,_}) ->
- discard.
+%% Answer that any other message is unsupported.
+handle_request(#diameter_packet{}, _SvcName, _) ->
+ {answer_message, 3001}. %% DIAMETER_COMMAND_UNSUPPORTED
%% ---------------------------------------------------------------------------
%% Answer using the record or list encoding depending on
%% Re-Auth-Request-Type. This is just as an example. You would
-%% typically just choose one, and this has nothing to do with the how
+%% typically just choose one, and this has nothing to do with how
%% client.erl sends.
answer(0, Id, OH, OR) ->