aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-08-09 15:20:36 +0200
committerAnders Svensson <[email protected]>2017-08-09 15:20:36 +0200
commit0c4a4aa70c5bceb9c38ddc939cfa66f16e943550 (patch)
treece8eaaadb8a4c06130f13a72b40fb20b2a6409c3 /lib/diameter/src/base
parent7c8213e3a2da91eca40ae8fcbadae07dcbb9f4c8 (diff)
parentcfb3eeaf354d99d0e62e6cf939b1320c4bdb0840 (diff)
downloadotp-0c4a4aa70c5bceb9c38ddc939cfa66f16e943550.tar.gz
otp-0c4a4aa70c5bceb9c38ddc939cfa66f16e943550.tar.bz2
otp-0c4a4aa70c5bceb9c38ddc939cfa66f16e943550.zip
Merge branch 'anders/diameter/message_cb/OTP-14486' into maint
* anders/diameter/message_cb/OTP-14486: Add simple message_cb to example server Fix inappropriate message callbacks
Diffstat (limited to 'lib/diameter/src/base')
-rw-r--r--lib/diameter/src/base/diameter_peer_fsm.erl20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl
index 1b0dc417e5..e43b3f54cf 100644
--- a/lib/diameter/src/base/diameter_peer_fsm.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm.erl
@@ -542,11 +542,11 @@ put_route(Pid) ->
MRef = monitor(process, Pid),
put(Pid, MRef).
-%% get_route/2
+%% get_route/3
-%% incoming answer
-get_route(_, #diameter_packet{header = #diameter_header{is_request = false}}
- = Pkt) ->
+%% Incoming answer.
+get_route(_, _, #diameter_packet{header = #diameter_header{is_request = false}}
+ = Pkt) ->
Seqs = diameter_codec:sequence_numbers(Pkt),
case erase(Seqs) of
{Pid, Ref, MRef} ->
@@ -557,8 +557,14 @@ get_route(_, #diameter_packet{header = #diameter_header{is_request = false}}
false
end;
-%% incoming request
-get_route(Ack, _) ->
+%% Requests answered here ...
+get_route(_, N, _)
+ when N == 'CER';
+ N == 'DPR' ->
+ false;
+
+%% ... or not.
+get_route(Ack, _, _) ->
Ack.
%% erase_route/1
@@ -650,7 +656,7 @@ encode(Rec, Opts, Dict) ->
%% incoming/2
incoming({recv = T, Name, Pkt}, #state{parent = Pid, ack = Ack} = S) ->
- Pid ! {T, self(), get_route(Ack, Pkt), Name, Pkt},
+ Pid ! {T, self(), get_route(Ack, Name, Pkt), Name, Pkt},
rcv(Name, Pkt, S);
incoming(#diameter_header{is_request = R}, #state{transport = TPid,