diff --git a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackList.java b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackList.java index d013b8a06..3c6c25249 100644 --- a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackList.java +++ b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackList.java @@ -309,6 +309,9 @@ private void reloadConfig() { @Override public @NotNull CheckResult shouldBanPeer(@NotNull Torrent torrent, @NotNull Peer peer, @NotNull Downloader downloader, @NotNull ExecutorService ruleExecuteExecutor) { + if (isHandShaking(peer)) { + return handshaking(); + } return getCache().readCacheButWritePassOnly(this, peer.getPeerAddress().getIp(), () -> { PeerAddress peerAddress = peer.getPeerAddress(); if (ports.contains(peerAddress.getPort())) { diff --git a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackRuleList.java b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackRuleList.java index e1916c009..b21bacd69 100644 --- a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackRuleList.java +++ b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/IPBlackRuleList.java @@ -123,6 +123,9 @@ public ReloadResult reloadModule() throws Exception { @Override public @NotNull CheckResult shouldBanPeer(@NotNull Torrent torrent, @NotNull Peer peer, @NotNull Downloader downloader, @NotNull ExecutorService ruleExecuteExecutor) { + if (isHandShaking(peer)) { + return handshaking(); + } return getCache().readCacheButWritePassOnly(this, peer.getPeerAddress().getIp(), () -> { String ip = peer.getPeerAddress().getIp(); List results = new ArrayList<>(); diff --git a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/PTRBlacklist.java b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/PTRBlacklist.java index f4c7b9fcb..d4fd4a1d9 100644 --- a/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/PTRBlacklist.java +++ b/src/main/java/com/ghostchu/peerbanhelper/module/impl/rule/PTRBlacklist.java @@ -98,6 +98,9 @@ public void reloadConfig() { @Override public @NotNull CheckResult shouldBanPeer(@NotNull Torrent torrent, @NotNull Peer peer, @NotNull Downloader downloader, @NotNull ExecutorService ruleExecuteExecutor) { + if (isHandShaking(peer)) { + return handshaking(); + } var reverseDnsLookupString = peer.getPeerAddress().getAddress().toReverseDNSLookupString(); return getCache().readCache(this, reverseDnsLookupString, () -> { Optional ptr;