[Python-apps-commits] r13141 - in packages/sabnzbdplus/trunk/debian/patches (1 file)

jcfp-guest at users.alioth.debian.org jcfp-guest at users.alioth.debian.org
Wed Apr 27 23:27:57 UTC 2016


    Date: Wednesday, April 27, 2016 @ 23:27:55
  Author: jcfp-guest
Revision: 13141

Adjust patch 09 to allow local v6 lookup

Modified:
  packages/sabnzbdplus/trunk/debian/patches/09_remove_external_resources.diff

Modified: packages/sabnzbdplus/trunk/debian/patches/09_remove_external_resources.diff
===================================================================
--- packages/sabnzbdplus/trunk/debian/patches/09_remove_external_resources.diff	2016-04-27 21:43:27 UTC (rev 13140)
+++ packages/sabnzbdplus/trunk/debian/patches/09_remove_external_resources.diff	2016-04-27 23:27:55 UTC (rev 13141)
@@ -30,18 +30,18 @@
      return icon
 --- a/sabnzbd/__init__.py
 +++ b/sabnzbd/__init__.py
-@@ -1159,7 +1159,7 @@
+@@ -1168,6 +1168,8 @@
+         logging.debug("Test IPv6: Disabling IPv6, because it looks like it's not available. Reason: %s", sys.exc_info()[0] )
+         return False
  
- def test_ipv6():
-     """ Check if external IPv6 addresses are reachable """
--    if not cfg.selftest_host():
-+    if not cfg.selftest_host() or sabnzbd.cfg.log_level() < 2:
-         # User disabled the test, assume active IPv6
-         return True
++    if sabnzbd.cfg.log_level() < 2:
++	return True
      try:
+         af, socktype, proto, canonname, sa = info[0]
+         sock = socket.socket(af, socktype, proto)
 --- a/sabnzbd/getipaddress.py
 +++ b/sabnzbd/getipaddress.py
-@@ -36,6 +36,10 @@
+@@ -36,6 +36,9 @@
      return ipv4
  
  def publicipv4():
@@ -51,16 +51,6 @@
      # Because of dual IPv4/IPv6 clients, finding the public ipv4 needs special attention, 
      # meaning forcing IPv4 connections, and not allowing IPv6 connections
      try:
-@@ -73,6 +77,10 @@
-     return public_ipv4
- 
- def ipv6():
-+    if sabnzbd.cfg.log_level() < 2:
-+        ipv6 = None
-+        return ipv6
-     try:
-         s_ipv6 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
-         s_ipv6.connect(('2001:db8::8080', 80))    # IPv6 prefix for documentation purpose
 --- a/sabnzbd/interface.py
 +++ b/sabnzbd/interface.py
 @@ -2466,8 +2466,11 @@
@@ -68,12 +58,11 @@
          if not kwargs.get('skip_dashboard'):
              header['localipv4'] = localipv4()
 -            header['publicipv4'] = publicipv4()
--            header['ipv6'] = ipv6()
+             header['ipv6'] = ipv6()
 +            if sabnzbd.cfg.log_level() < 2:
-+                header['publicipv4'] = header['ipv6'] = 'disabled at log level < 2 (debug)'
++                header['publicipv4'] = 'for privacy reasons, lookup is disabled at log levels smaller than 2 (debug)'
 +            else:
 +                header['publicipv4'] = publicipv4()
-+                header['ipv6'] = ipv6()
              # Dashboard: DNS-check
              try:
                  socket.gethostbyname(cfg.selftest_host())




More information about the Python-apps-commits mailing list