[add] 删除namespace规则

This commit is contained in:
wujiawei
2025-06-16 00:34:06 +08:00
parent 2add2ddfa7
commit 513c8ba095
5 changed files with 7 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ public class ChannelContext {
// 如果服务端已经存在 移除
if (cacheClientChannelConcurrentHashMap.containsKey(clientId)) {
List<Channel> existChannelList = new ArrayList<>();
List<Channel> oldChannels = cacheClientChannelConcurrentHashMap.getOrDefault(clientId, new ArrayList<>());
List<Channel> oldChannels = cacheClientChannelConcurrentHashMap.get(clientId);
for (Channel existChannel : oldChannels) {
if (existChannel != null) {
if (existChannel.isActive()) {
@@ -48,7 +48,7 @@ public class ChannelContext {
existChannelList.add(channel);
cacheClientChannelConcurrentHashMap.put(clientId, existChannelList);
} else {
cacheClientChannelConcurrentHashMap.put(clientId, Collections.synchronizedList(new ArrayList<>(List.of(channel))));
cacheClientChannelConcurrentHashMap.putIfAbsent(clientId, Collections.synchronizedList(new ArrayList<>(List.of(channel))));
}
}

View File

@@ -16,7 +16,7 @@ import java.nio.charset.StandardCharsets;
@Getter
public class NettyProxyMsg {
// body 长度 type 1 isSsl 1 appKey 4 appSecret 4 clientId 4 originalIp 4 targetIp 4 targetPort 4 visitorPort 4 visitorId 4 data 4
public static final int bodyLength = 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
public static final int bodyLength = 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
/**