Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Remove dead upgrade-related code
Browse files Browse the repository at this point in the history
Not needed with the parent commit's restart_application.
  • Loading branch information
Anders Svensson committed Jun 20, 2015
1 parent 62e4593 commit 2ee2148
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 43 deletions.
31 changes: 5 additions & 26 deletions lib/diameter/src/base/diameter_peer_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
service :: #diameter_service{},
dpr = false :: false
| true %% DPR received, DPA sent
| {uint32(), uint32()} %% set in old code
| {boolean(), uint32(), uint32()},
%% hop by hop and end to end identifiers in
%% outgoing DPR; boolean says whether or not
Expand Down Expand Up @@ -155,8 +154,7 @@
%% # start/3
%% ---------------------------------------------------------------------------

-spec start(T, [Opt], {[diameter:service_opt()]
| diameter:sequence(), %% from old code
-spec start(T, [Opt], {[diameter:service_opt()],
[node()],
module(),
#diameter_service{}})
Expand Down Expand Up @@ -195,9 +193,6 @@ init(T) ->
proc_lib:init_ack({ok, self()}),
gen_server:enter_loop(?MODULE, [], i(T)).

i({Ack, WPid, T, Opts, {{_,_} = Mask, Nodes, Dict0, Svc}}) -> %% from old code
i({Ack, WPid, T, Opts, {[{sequence, Mask}], Nodes, Dict0, Svc}});

i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) ->
erlang:monitor(process, WPid),
wait(Ack, WPid),
Expand Down Expand Up @@ -329,14 +324,11 @@ handle_info(T, #state{} = State) ->
{?MODULE, Tag, Reason} ->
?LOG(stop, Tag),
{stop, {shutdown, Reason}, State}
end;
end.
%% The form of the throw caught here is historical. It's
%% significant that it's not a 2-tuple, as in ?FAILURE(Reason),
%% since these are caught elsewhere.

handle_info(T, S) -> %% started in old code
handle_info(T, #state{} = erlang:append_element(S, infinity)).

%% Note that there's no guarantee that the service and transport
%% capabilities are good enough to build a CER/CEA that can be
%% succesfully encoded. It's not checked at diameter:add_transport/2
Expand Down Expand Up @@ -366,9 +358,6 @@ eraser(Key) ->

%% transition/2

transition(T, #state{dpr = {Hid, Eid}} = S) -> %% DPR sent from old code
transition(T, S#state{dpr = {false, Hid, Eid}});

%% Connection to peer.
transition({diameter, {TPid, connected, Remote}},
#state{transport = TPid,
Expand Down Expand Up @@ -1296,25 +1285,15 @@ dpa_timer(Tmo) ->
erlang:send_after(Tmo, self(), dpa_timeout).

dpa_timeout() ->
dpa_timeout(getr(?DPA_KEY)).

dpa_timeout({_, Tmo}) ->
Tmo;
dpa_timeout(undefined) -> %% set in old code
?DPA_TIMEOUT;
dpa_timeout(Tmo) -> %% ditto
{_, Tmo} = getr(?DPA_KEY),
Tmo.

dpr_timer() ->
dpa_timer(dpr_timeout()).

dpr_timeout() ->
dpr_timeout(getr(?DPA_KEY)).

dpr_timeout({Tmo, _}) ->
Tmo;
dpr_timeout(_) -> %% set in old code
?DPR_TIMEOUT.
{Tmo, _} = getr(?DPA_KEY),
Tmo.

%% register_everywhere/1
%%
Expand Down
14 changes: 1 addition & 13 deletions lib/diameter/src/base/diameter_traffic.erl
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@
%% # make_recvdata/1
%% ---------------------------------------------------------------------------

make_recvdata([SvcName, PeerT, Apps, {_,_} = Mask | _]) -> %% from old code
make_recvdata([SvcName, PeerT, Apps, [{sequence, Mask}]]);

make_recvdata([SvcName, PeerT, Apps, SvcOpts | _]) ->
{_,_} = Mask = proplists:get_value(sequence, SvcOpts),
#recvdata{service_name = SvcName,
Expand Down Expand Up @@ -300,13 +297,7 @@ recv_request(TPid,
RecvData),
TPid,
Dict0,
RecvData);

recv_request(TPid, Pkt, Dict0, RecvData) -> %% from old code
recv_request(TPid,
Pkt,
Dict0,
#recvdata{} = erlang:append_element(RecvData, [])).
RecvData).

%% recv_R/5

Expand Down Expand Up @@ -1641,9 +1632,6 @@ pick_peer(SvcName,
Filter,
Xtra})).

pick({{_,_,_} = Transport, Mask}) -> %% from old code; dialyzer complains
{Transport, Mask, []}; %% about this

pick(false) ->
{error, no_connection};

Expand Down
5 changes: 1 addition & 4 deletions lib/diameter/src/base/diameter_watchdog.erl
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,6 @@ restart(S) -> %% reconnect has won race with timeout
%% state down rather then initial when receiving notification of an
%% open connection.

restart({T, Opts, Svc}, S) -> %% put in old code
restart({T, Opts, Svc, []}, S);

restart({{connect, _} = T, Opts, Svc, SvcOpts},
#watchdog{parent = Pid,
restrict = {R,_},
Expand All @@ -827,7 +824,7 @@ restart({{connect, _} = T, Opts, Svc, SvcOpts},
%% die. Note that a state machine never enters state REOPEN in this
%% case.
restart({{accept, _}, _, _, _}, #watchdog{restrict = {_, false}}) ->
stop; %% 'DOWN' was in old code: 'close' was not sent
stop;

%% Otherwise hang around until told to die, either by the service or
%% by another watchdog.
Expand Down

0 comments on commit 2ee2148

Please sign in to comment.