fix(quic): handle timeout event in data stream

This commit is contained in:
William Yang 2023-01-13 14:26:28 +01:00
parent 38247a9d62
commit d8fa65ea09
2 changed files with 8 additions and 1 deletions

View File

@ -280,6 +280,9 @@ handle_info({'EXIT', Pid, Reason}, #{streams := Streams} = S) ->
Reason =:= killed
->
{ok, S};
true ->
?SLOG(info, #{message => "Data stream unexpected exit", reason => Reason}),
{ok, S};
false ->
{stop, unknown_pid_down, S}
end.

View File

@ -233,7 +233,11 @@ do_handle_appl_msg({event, updated}, S) ->
handle_info(Deliver = {deliver, _, _}, S) ->
Delivers = [Deliver],
with_channel(handle_deliver, [Delivers], S).
with_channel(handle_deliver, [Delivers], S);
handle_info({timeout, Ref, Msg}, S) ->
with_channel(handle_timeout, [Ref, Msg], S);
handle_info(Info, State) ->
with_channel(handle_info, [Info], State).
with_channel(Fun, Args, #{channel := Channel, task_queue := Q} = S) when
Channel =/= undefined