From 159586da72cfe69bfe91ee1189c8db8c8f21e8ee Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sat, 21 Feb 2026 22:44:48 +0800 Subject: [PATCH] fix --- apps/sdlan/src/sdlan_stun.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/sdlan/src/sdlan_stun.erl b/apps/sdlan/src/sdlan_stun.erl index 82a994a..d209f6a 100644 --- a/apps/sdlan/src/sdlan_stun.erl +++ b/apps/sdlan/src/sdlan_stun.erl @@ -95,7 +95,6 @@ handle_cast(_Request, State) -> {noreply, NewState :: #state{}} | {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}). - handle_info({udp, Sock, Ip, Port, <>}, State = #state{socket = Sock}) -> StunRequest = catch sdlan_pb:decode_msg(Body, sdl_stun_request), %% 告知网络当前的ip对应的nat的映射关系 @@ -106,7 +105,11 @@ handle_info({udp, Sock, Ip, Port, <>}, Stat StunReply = sdlan_pb:encode_msg(#sdl_stun_reply{ cookie = Cookie }), - ok = gen_udp:send(Sock, Ip, Port, <>), + + + logger:debug("[sdlan_stun] xyz, reply size: ~p", [byte_size(StunReply)]), + + ok = gen_udp:send(Sock, Ip, Port, <>), logger:debug("[sdlan_stun] stun_request network_id: ~p, client_id: ~p, hole: ~p, bytes: ~p", [NetworkId, ClientId, {Ip, Port}, byte_size(<>)]) end, {noreply, State};