diff options
author | Anders Svensson <[email protected]> | 2013-11-03 11:56:02 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-11-03 11:56:02 +0100 |
commit | 76c136ad24e30e4b99f078c228a364e5bbdd9257 (patch) | |
tree | e50a9428dbbca5b4da210a6a6aeb540525476d02 /lib/diameter/src | |
parent | 20641fe0f2ea745873fc7557448d3a7deb1bd639 (diff) | |
parent | 46a1d278fe063ffd08ae9538bb8a496b813fe661 (diff) | |
download | otp-76c136ad24e30e4b99f078c228a364e5bbdd9257.tar.gz otp-76c136ad24e30e4b99f078c228a364e5bbdd9257.tar.bz2 otp-76c136ad24e30e4b99f078c228a364e5bbdd9257.zip |
Merge branch 'anders/diameter/broken_dwa/OTP-11367' into anders/diameter/patch_release/OTP-11459
* anders/diameter/broken_dwa/OTP-11367:
Fix broken DWA
Diffstat (limited to 'lib/diameter/src')
-rw-r--r-- | lib/diameter/src/base/diameter_watchdog.erl | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl index 7e75801718..127a647b89 100644 --- a/lib/diameter/src/base/diameter_watchdog.erl +++ b/lib/diameter/src/base/diameter_watchdog.erl @@ -461,15 +461,28 @@ eraser(Key) -> %% encode/3 -encode(Msg, Mask, Dict) -> +encode(dwr = M, Dict0, Mask) -> + Msg = getr(M), Seq = diameter_session:sequence(Mask), Hdr = #diameter_header{version = ?DIAMETER_VERSION, end_to_end_id = Seq, hop_by_hop_id = Seq}, Pkt = #diameter_packet{header = Hdr, msg = Msg}, - #diameter_packet{bin = Bin} = diameter_codec:encode(Dict, Pkt), - Bin. + #diameter_packet{bin = Bin} = diameter_codec:encode(Dict0, Pkt), + Bin; + + +encode(dwa, Dict0, #diameter_packet{header = H, transport_data = TD} + = ReqPkt) -> + AnsPkt = #diameter_packet{header + = H#diameter_header{is_request = false, + is_error = undefined, + is_retransmitted = false}, + msg = dwa(ReqPkt), + transport_data = TD}, + + diameter_codec:encode(Dict0, AnsPkt). %% okay/3 @@ -527,7 +540,7 @@ send_watchdog(#watchdog{pending = false, dictionary = Dict0, sequence = Mask} = S) -> - send(TPid, {send, encode(getr(dwr), Mask, Dict0)}), + send(TPid, {send, encode(dwr, Dict0, Mask)}), ?LOG(send, 'DWR'), S#watchdog{pending = true}. @@ -546,9 +559,8 @@ recv(Name, Pkt, S) -> %% rcv/3 rcv('DWR', Pkt, #watchdog{transport = TPid, - dictionary = Dict0, - sequence = Mask}) -> - send(TPid, {send, encode(dwa(Pkt), Mask, Dict0)}), + dictionary = Dict0}) -> + send(TPid, {send, encode(dwa, Dict0, Pkt)}), ?LOG(send, 'DWA'); rcv(N, _, _) |