add debug

This commit is contained in:
anlicheng 2026-04-27 17:26:10 +08:00
parent bef6c87702
commit 6bce50ea65

View File

@ -430,10 +430,10 @@ handle_event(EventType, Info, StateName, State) ->
%% terminate. It should be the opposite of Module:init/1 and do any %% terminate. It should be the opposite of Module:init/1 and do any
%% necessary cleaning up. When it returns, the gen_statem terminates with %% necessary cleaning up. When it returns, the gen_statem terminates with
%% Reason. The return value is ignored. %% Reason. The return value is ignored.
terminate(Reason, _StateName, _State = #state{conn = Conn, stream = Stream, offline_cb = OfflineCb, close_reason = CloseReason}) -> terminate(Reason, _StateName, _State = #state{conn = Conn, stream = Stream, client_id = ClientId, offline_cb = OfflineCb, close_reason = CloseReason}) ->
Stream /= undefined andalso quicer:close_stream(Stream, 1000), Stream /= undefined andalso quicer:close_stream(Stream, 1000),
quicer:close_connection(Conn), quicer:close_connection(Conn),
logger:notice("[sdlan_quic_conn] terminate closed with reason: ~p, close_reason: ~p", [Reason, CloseReason]), logger:notice("[sdlan_quic_conn] client_id: ~p, terminate closed with reason: ~p, close_reason: ~p", [ClientId, Reason, CloseReason]),
%% 线 %% 线
is_function(OfflineCb) andalso OfflineCb(), is_function(OfflineCb) andalso OfflineCb(),
ok. ok.