diff options
author | Anders Svensson <[email protected]> | 2013-04-06 15:59:13 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-04-11 16:18:56 +0200 |
commit | 2e848e9290c2c912df46a7f9b4cd93ce002e9ba9 (patch) | |
tree | d94e6c260d590ff883149c806012cdd436d1541c /lib/diameter/src/base/diameter_peer_fsm.erl | |
parent | 157886e6b69e9c7cf1e0e6f8ea932a82b810ea12 (diff) | |
download | otp-2e848e9290c2c912df46a7f9b4cd93ce002e9ba9.tar.gz otp-2e848e9290c2c912df46a7f9b4cd93ce002e9ba9.tar.bz2 otp-2e848e9290c2c912df46a7f9b4cd93ce002e9ba9.zip |
Add transport interface 'connected' message with local address list
A transport module can return a local address list from its start/3
function in order to specify addresses to be used as Host-IP-Address
during capabilities exchange. Now allow addresses to be communicated in
a 'connected' message in the case of a connecting transport, so that
diameter_tcp (in particular) can make local address configuration
optional, communicating the gen_tcp default after connection
establishment instead.
Diffstat (limited to 'lib/diameter/src/base/diameter_peer_fsm.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_peer_fsm.erl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl index bee3e507fd..6be4259510 100644 --- a/lib/diameter/src/base/diameter_peer_fsm.erl +++ b/lib/diameter/src/base/diameter_peer_fsm.erl @@ -351,10 +351,17 @@ transition({diameter, {TPid, connected, Remote}}, mode = M} = S) -> {'Wait-Conn-Ack', _} = PS, %% assert - connect = M, %% + connect = M, %% keep_transport(TPid), send_CER(S#state{mode = {M, Remote}}); +transition({diameter, {TPid, connected, Remote, LAddrs}}, + #state{transport = TPid, + service = Svc} + = S) -> + transition({diameter, {TPid, connected, Remote}}, + S#state{service = readdr(Svc, LAddrs)}); + %% Connection from peer. transition({diameter, {TPid, connected}}, #state{transport = TPid, @@ -363,7 +370,7 @@ transition({diameter, {TPid, connected}}, parent = Pid} = S) -> {'Wait-Conn-Ack', Tmo} = PS, %% assert - accept = M, %% + accept = M, %% keep_transport(TPid), Pid ! {accepted, self()}, start_timer(Tmo, S#state{state = recv_CER}); @@ -376,6 +383,8 @@ transition({diameter, {_, connected}}, _) -> {stop, connection_timeout}; transition({diameter, {_, connected, _}}, _) -> {stop, connection_timeout}; +transition({diameter, {_, connected, _, _}}, _) -> + {stop, connection_timeout}; %% Connection has timed out: start an alternate. transition({connection_timeout = T, TPid}, |