remove hole
This commit is contained in:
parent
1467e7f724
commit
ab4527a8e7
@ -279,22 +279,22 @@ handle_call({peer_info, SrcMac, DstMac}, _From, State = #state{endpoints = Endpo
|
|||||||
case maps:find(DstMac, Endpoints) of
|
case maps:find(DstMac, Endpoints) of
|
||||||
{ok, #endpoint{channel_pid = DstChannelPid, hole = #hole{peer = DstNatPeer, nat_type = DstNatType}, v6_info = DstV6Info}} ->
|
{ok, #endpoint{channel_pid = DstChannelPid, hole = #hole{peer = DstNatPeer, nat_type = DstNatType}, v6_info = DstV6Info}} ->
|
||||||
%% 让目标服务器发送sendRegister事件(2024-06-25 新增,提高打洞的成功率)
|
%% 让目标服务器发送sendRegister事件(2024-06-25 新增,提高打洞的成功率)
|
||||||
maybe
|
%maybe
|
||||||
{ok, #endpoint{hole = #hole{peer = {SrcNatIp, SrcNatPort}, nat_type = SrcNatType}, v6_info = SrcV6Info}} ?= maps:find(SrcMac, Endpoints),
|
% {ok, #endpoint{hole = #hole{peer = {SrcNatIp, SrcNatPort}, nat_type = SrcNatType}, v6_info = SrcV6Info}} ?= maps:find(SrcMac, Endpoints),
|
||||||
|
|
||||||
RegisterEvent = sdlan_pb:encode_msg(#'SDLEvent' {
|
% RegisterEvent = sdlan_pb:encode_msg(#'SDLEvent' {
|
||||||
event = {send_register, #'SDLEvent.SendRegister'{
|
% event = {send_register, #'SDLEvent.SendRegister'{
|
||||||
dst_mac = SrcMac,
|
% dst_mac = SrcMac,
|
||||||
nat_ip = sdlan_util:ipv4_to_int(SrcNatIp),
|
% nat_ip = sdlan_util:ipv4_to_int(SrcNatIp),
|
||||||
nat_type = SrcNatType,
|
% nat_type = SrcNatType,
|
||||||
nat_port = SrcNatPort,
|
% nat_port = SrcNatPort,
|
||||||
v6_info = SrcV6Info
|
% v6_info = SrcV6Info
|
||||||
}}
|
% }}
|
||||||
}),
|
% }),
|
||||||
logger:debug("Event: send_register, for peer_info"),
|
% logger:debug("Event: send_register, for peer_info"),
|
||||||
|
|
||||||
sdlan_quic_channel:send_event(DstChannelPid, ?EVENT_SEND_REGISTER, RegisterEvent)
|
% sdlan_quic_channel:send_event(DstChannelPid, ?EVENT_SEND_REGISTER, RegisterEvent)
|
||||||
end,
|
%end,
|
||||||
{reply, {ok, {DstNatPeer, DstNatType}, DstV6Info}, State};
|
{reply, {ok, {DstNatPeer, DstNatType}, DstV6Info}, State};
|
||||||
_ ->
|
_ ->
|
||||||
{reply, error, State}
|
{reply, error, State}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user