aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/examples/server_cb.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-05-20 12:32:34 +0200
committerAnders Svensson <[email protected]>2011-05-20 12:32:34 +0200
commitce1bb47f364c58822339fa4b05e823aa52b3d7cb (patch)
tree6bb6040549917a9a442c9d8959a6f108baf90f2c /lib/diameter/examples/server_cb.erl
parent7715953ce12be54b1889ebf5af4ba694186370a8 (diff)
downloadotp-ce1bb47f364c58822339fa4b05e823aa52b3d7cb.tar.gz
otp-ce1bb47f364c58822339fa4b05e823aa52b3d7cb.tar.bz2
otp-ce1bb47f364c58822339fa4b05e823aa52b3d7cb.zip
Minor diameter_service fix when sending a diameter_header/avp list
plus an example fix.
Diffstat (limited to 'lib/diameter/examples/server_cb.erl')
-rw-r--r--lib/diameter/examples/server_cb.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/diameter/examples/server_cb.erl b/lib/diameter/examples/server_cb.erl
index b8705aedfc..43b8e24b5c 100644
--- a/lib/diameter/examples/server_cb.erl
+++ b/lib/diameter/examples/server_cb.erl
@@ -74,11 +74,8 @@ handle_request(#diameter_packet{msg = Req, errors = []}, _SvcName, {_, Caps})
{reply, answer(RT, Id, OH, OR)};
%% ... or one that wasn't. 3xxx errors are answered by diameter itself
-%% but these are non-3xxx errors for which we must contruct a reply.
-%% Returning a packet with the non-[] errors field will cause
-%% diameter to add the appropriate result code and Failed-AVPs avps.
-%% We just have to return the relevant answer record with any required
-%% avps.
+%% but these are 5xxx errors for which we must contruct a reply.
+%% diameter will set Result-Code and Failed-AVP's.
handle_request(#diameter_packet{msg = Req} = Pkt, _SvcName, {_, Caps})
when is_record(Req, diameter_base_RAR) ->
#diameter_caps{origin_host = {OH,_},
@@ -91,7 +88,7 @@ handle_request(#diameter_packet{msg = Req} = Pkt, _SvcName, {_, Caps})
'Origin-Realm' = OR,
'Session-Id' = Id},
- {reply, Pkt#diameter_packet{msg = Ans}};
+ {reply, Ans};
%% Should really reply to other base messages that we don't support
%% but simply discard them instead.