aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_codec.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-10-25 19:26:13 +0200
committerAnders Svensson <[email protected]>2011-11-10 16:23:50 +0100
commitd415d9cd2c1adba28ce901ea1dd382cca96ae06c (patch)
tree792577aa0fe6d5b4cd57595c9e18227a073dcd62 /lib/diameter/src/base/diameter_codec.erl
parenta138f8420ed0386c6200899254190600bf121f97 (diff)
downloadotp-d415d9cd2c1adba28ce901ea1dd382cca96ae06c.tar.gz
otp-d415d9cd2c1adba28ce901ea1dd382cca96ae06c.tar.bz2
otp-d415d9cd2c1adba28ce901ea1dd382cca96ae06c.zip
Send events for connection establishment failure
If a peer fsm process exits then the exit reason is received by the service process in a 'DOWN' message. If the reason is the one generated by diameter_peer_fsm:close/2, which is called to signal a non-transport failure before the completion of capabilities exchange (eg. receiving an unsuccessful CEA), then an event is sent to any subscribers. Also, tweak capabilities_cb return values for more informative event data.
Diffstat (limited to 'lib/diameter/src/base/diameter_codec.erl')
-rw-r--r--lib/diameter/src/base/diameter_codec.erl22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index d88f42fb7c..fe1212b7e0 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -190,26 +190,13 @@ encode_avps(Avps) ->
%% msg_header/3
-msg_header(Mod, MsgName, Header) ->
- {Code, Flags, ApplId} = h(Mod, MsgName, Header),
- {Code, p(Flags, Header), ApplId}.
-
-%% 6.2 of 3588 requires the same 'P' bit on an answer as on the
-%% request.
-
-p(Flags, #diameter_header{is_request = true,
- is_proxiable = P}) ->
- Flags band (2#10110000 bor choose(P, 2#01000000, 0));
-p(Flags, _) ->
- Flags.
-
-h(Mod, 'answer-message' = MsgName, Header) ->
+msg_header(Mod, 'answer-message' = MsgName, Header) ->
?BASE = Mod,
#diameter_header{cmd_code = Code} = Header,
{_, Flags, ApplId} = ?BASE:msg_header(MsgName),
{Code, Flags, ApplId};
-h(Mod, MsgName, _) ->
+msg_header(Mod, MsgName, _) ->
Mod:msg_header(MsgName).
%% rec2msg/2
@@ -554,8 +541,3 @@ pack_avp(Code, Flags, Vid, Sz, Bin) ->
pack_avp(Code, Flags, Sz, Bin) ->
Length = Sz + 8,
<<Code:32, Flags:8, Length:24, Bin/binary>>.
-
-%% ===========================================================================
-
-choose(true, X, _) -> X;
-choose(false, _, X) -> X.