Fallback to using DNS for geoip lookups if the database file is not
available
This commit is contained in:
parent
98f65f13cf
commit
88346a5722
@ -211,9 +211,10 @@ class Core(
|
|||||||
self.settings = lt.session_settings()
|
self.settings = lt.session_settings()
|
||||||
self.settings.user_agent = "Deluge %s" % deluge.common.get_version()
|
self.settings.user_agent = "Deluge %s" % deluge.common.get_version()
|
||||||
|
|
||||||
# Load the GeoIP DB for country look-ups
|
# Load the GeoIP DB for country look-ups if available
|
||||||
self.session.load_country_db(
|
geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
|
||||||
pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat")))
|
if os.path.exists(geoip_db):
|
||||||
|
self.session.load_country_db(geoip_db)
|
||||||
|
|
||||||
# Set session settings
|
# Set session settings
|
||||||
self.settings.lazy_bitfields = 1
|
self.settings.lazy_bitfields = 1
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -345,7 +345,7 @@ setup(
|
|||||||
author = "Andrew Resch, Marcos Pinto, Martijn Voncken, Sadrul Habib Chowdhury",
|
author = "Andrew Resch, Marcos Pinto, Martijn Voncken, Sadrul Habib Chowdhury",
|
||||||
author_email = "andrewresch@gmail.com, markybob@dipconsultants.com, \
|
author_email = "andrewresch@gmail.com, markybob@dipconsultants.com, \
|
||||||
mvoncken@gmail.com, sadrul@users.sourceforge.net",
|
mvoncken@gmail.com, sadrul@users.sourceforge.net",
|
||||||
cmdclass=cmdclass,
|
cmdclass = cmdclass,
|
||||||
data_files = _data_files,
|
data_files = _data_files,
|
||||||
description = "Bittorrent Client",
|
description = "Bittorrent Client",
|
||||||
entry_points = """
|
entry_points = """
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user