remove debug

This commit is contained in:
anlicheng 2026-04-16 21:00:46 +08:00
parent 5f5effcd84
commit c907a2f6b0
2 changed files with 26 additions and 4 deletions

View File

@ -80,13 +80,10 @@ handle_cast(_Request, State) ->
{noreply, NewState :: #state{}, timeout() | hibernate} | {noreply, NewState :: #state{}, timeout() | hibernate} |
{stop, Reason :: term(), NewState :: #state{}}. {stop, Reason :: term(), NewState :: #state{}}.
handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) -> handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) ->
logger:debug("[ipv6_assist_server] get request"),
maybe maybe
ThrottleKey = {Ip, Port}, ThrottleKey = {Ip, Port},
ok ?= limit_check(ThrottleKey), ok ?= limit_check(ThrottleKey),
logger:debug("[ipv6_assist_server] get request11"),
#'SDLV6AssistProbe'{pkt_id = PktId} ?= catch sdlan_pb:decode_msg(Body, 'SDLV6AssistProbe'), #'SDLV6AssistProbe'{pkt_id = PktId} ?= catch sdlan_pb:decode_msg(Body, 'SDLV6AssistProbe'),
logger:debug("[ipv6_assist_server] get request22"),
V6Bytes = sdlan_util:ipv6_to_bytes(Ip), V6Bytes = sdlan_util:ipv6_to_bytes(Ip),
ReplyBin = sdlan_pb:encode_msg(#'SDLV6AssistProbeReply'{ ReplyBin = sdlan_pb:encode_msg(#'SDLV6AssistProbeReply'{
pkt_id = PktId, pkt_id = PktId,
@ -95,7 +92,6 @@ handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) ->
port = Port port = Port
} }
}), }),
logger:debug("[ipv6_assist_server] get request33"),
ok ?= gen_udp:send(Sock, Ip, Port, ReplyBin) ok ?= gen_udp:send(Sock, Ip, Port, ReplyBin)
end, end,
{noreply, State}; {noreply, State};

View File

@ -0,0 +1,26 @@
%%%-------------------------------------------------------------------
%%% @author anlicheng
%%% @copyright (C) 2026, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 16. 4 2026 20:53
%%%-------------------------------------------------------------------
-module(test_ipv6_udp).
-author("anlicheng").
%% API
-export([test/0]).
test() ->
Opts = [
binary,
inet6,
{reuseaddr, true},
{reuseport, true},
{active, true},
{recbuf, 5 * 1024 * 1024},
{sndbuf, 5 * 1024 * 1024}
],
{ok, Socket} = gen_udp:open(0, Opts),
ok = gen_udp:send(Socket, "2408:4005:318:4900:164a:b5c6:9023:ca8d", 1367, <<"hello world">>).