From d57deaa8e4869b80abca12d027c24bb86a08c054 Mon Sep 17 00:00:00 2001 From: Vadim Ushakov Date: Sat, 13 Jul 2019 15:36:05 +0700 Subject: [PATCH] TrackerShare: ignore the udp:// protocol, when UDP is known to be disabled by the config --- plugins/TrackerShare/TrackerSharePlugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/TrackerShare/TrackerSharePlugin.py b/plugins/TrackerShare/TrackerSharePlugin.py index 558163ed..156f7fd2 100644 --- a/plugins/TrackerShare/TrackerSharePlugin.py +++ b/plugins/TrackerShare/TrackerSharePlugin.py @@ -75,6 +75,9 @@ class TrackerStorage(object): if not self.isTrackerAddressValid(address): del trackers[address] + def isUdpEnabled(self): + return not (config.disable_udp or config.trackers_proxy != "disable") + def getNormalizedTrackerProtocol(self, tracker_address): if not self.site_announcer: return None @@ -111,6 +114,8 @@ class TrackerStorage(object): protocol = self.getNormalizedTrackerProtocol(tracker_address) if not protocol: continue + if protocol == "udp" and not self.isUdpEnabled(): + continue protocols.add(protocol) protocols = list(protocols)