This commit is contained in:
snltty
2025-07-24 00:50:20 +08:00
parent 5e923276ee
commit 8809466c18
2 changed files with 8 additions and 3 deletions

View File

@@ -103,6 +103,9 @@ namespace linker.tunnel.transport
if (connectionsDic.TryGetValue(remoteEP, out ConnectionCacheInfo cache) == false) if (connectionsDic.TryGetValue(remoteEP, out ConnectionCacheInfo cache) == false)
{ {
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
LoggerHelper.Instance.Debug($"{Name} recv from {result.RemoteEndPoint} <{memory.GetString()}>");
if (memory.Length > flagBytes.Length && memory.Span.Slice(0, flagBytes.Length).SequenceEqual(flagBytes)) if (memory.Length > flagBytes.Length && memory.Span.Slice(0, flagBytes.Length).SequenceEqual(flagBytes))
{ {
string key = memory.GetString(); string key = memory.GetString();
@@ -321,10 +324,12 @@ namespace linker.tunnel.transport
} }
await targetSocket.SendToAsync($"{flagTexts}-{tunnelTransportInfo.Local.MachineId}-{tunnelTransportInfo.FlowId}".ToBytes(), ep).ConfigureAwait(false); await targetSocket.SendToAsync($"{flagTexts}-{tunnelTransportInfo.Local.MachineId}-{tunnelTransportInfo.FlowId}".ToBytes(), ep).ConfigureAwait(false);
await targetSocket.ReceiveFromAsync(new byte[1024], new IPEndPoint(ep.AddressFamily == AddressFamily.InterNetwork ? IPAddress.Any : IPAddress.IPv6Any, 0)).WaitAsync(TimeSpan.FromMilliseconds(500)).ConfigureAwait(false);
byte[] buffer = new byte[1024];
SocketReceiveFromResult recv = await targetSocket.ReceiveFromAsync(buffer, new IPEndPoint(ep.AddressFamily == AddressFamily.InterNetwork ? IPAddress.Any : IPAddress.IPv6Any, 0)).WaitAsync(TimeSpan.FromMilliseconds(500)).ConfigureAwait(false);
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
LoggerHelper.Instance.Debug($"{Name} connect to {tunnelTransportInfo.Remote.MachineId}->{tunnelTransportInfo.Remote.MachineName} {ep} success"); LoggerHelper.Instance.Debug($"{Name} connect to {tunnelTransportInfo.Remote.MachineId}->{tunnelTransportInfo.Remote.MachineName} {ep} success -> <{buffer.AsMemory(0, recv.ReceivedBytes).GetString()}>");
TunnelConnectionUdp result = new TunnelConnectionUdp TunnelConnectionUdp result = new TunnelConnectionUdp
{ {

View File

@@ -1,5 +1,5 @@
v1.8.8 v1.8.8
2025-07-24 00:01:22 2025-07-24 00:50:20
1. 一些累计更新 1. 一些累计更新
2. 管理端输入去除多余空格 2. 管理端输入去除多余空格
3. 中继节点自动更新 3. 中继节点自动更新