add debug

This commit is contained in:
anlicheng 2026-02-05 22:03:27 +08:00
parent 42dbb48e18
commit 588b05b24b

View File

@ -394,6 +394,7 @@ handle_cast({stun_request, Sock, Peer = {ClientIp, ClientPort}, #sdl_stun_reques
%%
handle_cast({policy_request, Sock, {ClientIp, ClientPort}, #sdl_policy_request{client_id = ClientId, version = Version, mac = Mac, src_identity_id = SrcIdentityId, dst_identity_id = DstIdentityId, session_token = ST}},
State = #state{network_id = NetworkId, endpoints = Endpoints}) ->
logger:debug("[sdlan_network] policy_request, src_identity: ~p, dst_identity: ~p, version: ~p", [SrcIdentityId, DstIdentityId, Version]),
maybe
{ok, #endpoint{client_id = ClientId, session_token = ST}} ?= maps:find(Mac, Endpoints),
@ -408,6 +409,7 @@ handle_cast({policy_request, Sock, {ClientIp, ClientPort}, #sdl_policy_request{c
}),
PolicyResponsePkt = <<?PACKET_POLICY_RESPONSE, PolicyResponse/binary>>,
logger:debug("[sdlan_network] will send policy response: ~p", [PolicyResponse]),
gen_udp:send(Sock, ClientIp, ClientPort, PolicyResponsePkt)
end,