aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_traffic.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-03-18 19:29:23 +0100
committerAnders Svensson <[email protected]>2013-03-18 19:29:23 +0100
commit4ac5deb44293aa78ee53dae0e190733442a2c6c6 (patch)
tree41296110ca32aef3c20291efa4d16c9dd9e1b9d3 /lib/diameter/src/base/diameter_traffic.erl
parent887577cfaeee55461f1e8f7b4f9472cbca1d2a2e (diff)
parentecebd37eb5e874e307812373c072f685455a2eee (diff)
downloadotp-4ac5deb44293aa78ee53dae0e190733442a2c6c6.tar.gz
otp-4ac5deb44293aa78ee53dae0e190733442a2c6c6.tar.bz2
otp-4ac5deb44293aa78ee53dae0e190733442a2c6c6.zip
Merge branch 'anders/diameter/distribution/OTP-9610' into maint
* anders/diameter/distribution/OTP-9610: Specify timeouts to ct_slave:start/2 More flexible distribution config Add distribution suite Document distribution config Distribution fixes
Diffstat (limited to 'lib/diameter/src/base/diameter_traffic.erl')
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index f527f7c754..25b902e3f2 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1479,12 +1479,14 @@ send({TPid, Pkt, #request{handler = Pid} = Req, SvcName, Timeout, TRef}) ->
Req#request{handler = self()},
SvcName,
Timeout),
- Pid ! reref(receive T -> T end, Ref, TRef).
-
-reref({T, Ref, R}, Ref, TRef) ->
- {T, TRef, R};
-reref(T, _, _) ->
- T.
+ receive
+ {answer, _, _, _, _} = A ->
+ Pid ! A;
+ {failover = T, Ref} ->
+ Pid ! {T, TRef};
+ T ->
+ exit({timeout, Ref, TPid} = T)
+ end.
%% send/2
@@ -1559,7 +1561,7 @@ resend_request(Pkt0,
store_request(TPid, Bin, Req, Timeout) ->
Seqs = diameter_codec:sequence_numbers(Bin),
- TRef = erlang:start_timer(Timeout, self(), timeout),
+ TRef = erlang:start_timer(Timeout, self(), TPid),
ets:insert(?REQUEST_TABLE, {Seqs, Req, TRef}),
ets:member(?REQUEST_TABLE, TPid)
orelse (self() ! {failover, TRef}), %% failover/1 may have missed