Skip to content

Commit

Permalink
handle ?SHUTDOWN_CHECKPOINT as well
Browse files Browse the repository at this point in the history
  • Loading branch information
abijr committed Mar 1, 2024
1 parent ecb92de commit 5df0db1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/erlmld_wrk_statem.erl
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ handle_event(?INTERNAL,
end,
ok = gen_tcp:send(Socket, [IoData, "\n"]),
case NextReadKind of
?SHUTDOWN ->
Kind when Kind == ?SHUTDOWN; Kind == ?SHUTDOWN_CHECKPOINT ->
%% next state is waiting for the MLD to close the connection.
%% But it might not happen, so we'll close it ourselves after a timeout.
%% Note that this timeout gets cancelled if we have state changes before it fires.
{next_state, {?PEER_READ, ?SHUTDOWN}, activate(Data), [{state_timeout, 5000, shutdown}]};
{next_state, {?PEER_READ, Kind}, activate(Data), [{state_timeout, 5000, shutdown}]};
_ ->
{next_state, {?PEER_READ, NextReadKind}, activate(Data)}
end;
Expand Down

0 comments on commit 5df0db1

Please sign in to comment.