aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_traffic.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-01-19 21:05:41 +0100
committerAnders Svensson <[email protected]>2015-01-19 21:05:41 +0100
commitbf351d224810e95330c8d317b6d54cc010c5f8f0 (patch)
treee0d9e63a45aa6078d0cc4034b58a7fc045af498d /lib/diameter/src/base/diameter_traffic.erl
parentaf87b1c3d4897840d8247589a88d3611106ecedc (diff)
downloadotp-bf351d224810e95330c8d317b6d54cc010c5f8f0.tar.gz
otp-bf351d224810e95330c8d317b6d54cc010c5f8f0.tar.bz2
otp-bf351d224810e95330c8d317b6d54cc010c5f8f0.zip
Fix retransmission of messages sent as header/avps list
Extracting the End-to-End and Hop-by-Hop identifiers resulted in a function clause error, causing the send to fail.
Diffstat (limited to 'lib/diameter/src/base/diameter_traffic.erl')
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index 3b62afca47..d9877bdd8e 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1388,6 +1388,21 @@ make_request_packet(#diameter_packet{header = Hdr} = Pkt,
make_request_packet(Msg, Pkt) ->
Pkt#diameter_packet{msg = Msg}.
+%% make_retransmit_packet/2
+
+make_retransmit_packet(#diameter_packet{msg = [#diameter_header{} = Hdr
+ | Avps]}
+ = Pkt) ->
+ Pkt#diameter_packet{msg = [make_retransmit_header(Hdr) | Avps]};
+
+make_retransmit_packet(#diameter_packet{header = Hdr} = Pkt) ->
+ Pkt#diameter_packet{header = make_retransmit_header(Hdr)}.
+
+%% make_retransmit_header/1
+
+make_retransmit_header(Hdr) ->
+ Hdr#diameter_header{is_retransmitted = true}.
+
%% fold_record/2
fold_record(undefined, R) ->
@@ -1674,9 +1689,7 @@ retransmit({TPid, Caps, App}
have_request(Pkt0, TPid) %% Don't failover to a peer we've
andalso ?THROW(timeout), %% already sent to.
- #diameter_packet{header = Hdr0} = Pkt0,
- Hdr = Hdr0#diameter_header{is_retransmitted = true},
- Pkt = Pkt0#diameter_packet{header = Hdr},
+ Pkt = make_retransmit_packet(Pkt0),
retransmit(cb(App, prepare_retransmit, [Pkt, SvcName, {TPid, Caps}]),
Transport,