diff options
author | Anders Svensson <[email protected]> | 2017-06-23 23:19:14 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-06-25 12:44:26 +0200 |
commit | 67d4e19831ede890c88e21a7c520010a4c4b9430 (patch) | |
tree | e14b9e549fc85c69a71ecfda61dcef642e0873ba /lib/diameter/src/base | |
parent | 040bdce67f88d833bfb59adae130a4ffb4c180f0 (diff) | |
download | otp-67d4e19831ede890c88e21a7c520010a4c4b9430.tar.gz otp-67d4e19831ede890c88e21a7c520010a4c4b9430.tar.bz2 otp-67d4e19831ede890c88e21a7c520010a4c4b9430.zip |
Fix inappropriate message callbacks
Commit ca09cf7b caused an incoming CER or DPR to be regarded as
discarded in diameter_watchdog, resulting in a corresponding message
callback (if configured) in diameter_tcp/sctp.
Diffstat (limited to 'lib/diameter/src/base')
-rw-r--r-- | lib/diameter/src/base/diameter_peer_fsm.erl | 20 |
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, |