diff options
author | Anders Svensson <[email protected]> | 2013-02-23 20:40:00 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-03-17 15:05:57 +0100 |
commit | 86400f7630699395cbe6f78864de4534c913be4c (patch) | |
tree | f469de2f262e4b11a3fdca6dbfc24247088ad3ee /lib/diameter/src/base/diameter_traffic.erl | |
parent | 51bd468142e4c9974c7e778769b7930895010d44 (diff) | |
download | otp-86400f7630699395cbe6f78864de4534c913be4c.tar.gz otp-86400f7630699395cbe6f78864de4534c913be4c.tar.bz2 otp-86400f7630699395cbe6f78864de4534c913be4c.zip |
Distribution fixes
This is the functionality that allows transports to be shared between
identically-named services on different nodes, which has been neither
documented nor tested (until now).
Diffstat (limited to 'lib/diameter/src/base/diameter_traffic.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_traffic.erl | 16 |
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 |