Fix 2160 : Disable use of python bindings for libtorrent extensions and replace with session flag
The fixes a GIL issue causing libtorrent segfault. https://code.google.com/p/libtorrent/issues/detail?id=369 Note: The ut_pex plugin (Peer Exchange) will now always be enabled.
This commit is contained in:
parent
1ec51cec18
commit
f6c201f02f
|
@ -81,7 +81,10 @@ class Core(component.Component):
|
||||||
while len(version) < 4:
|
while len(version) < 4:
|
||||||
version.append(0)
|
version.append(0)
|
||||||
|
|
||||||
self.session = lt.session(lt.fingerprint("DE", *version), flags=0)
|
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
|
||||||
|
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
|
||||||
|
# Setting session flags to 1 enables all libtorrent default plugins
|
||||||
|
self.session = lt.session(lt.fingerprint("DE", *version), flags=1)
|
||||||
|
|
||||||
# Load the session state if available
|
# Load the session state if available
|
||||||
self.__load_session_state()
|
self.__load_session_state()
|
||||||
|
@ -102,9 +105,11 @@ class Core(component.Component):
|
||||||
self.session.set_settings(self.settings)
|
self.session.set_settings(self.settings)
|
||||||
|
|
||||||
# Load metadata extension
|
# Load metadata extension
|
||||||
self.session.add_extension(lt.create_metadata_plugin)
|
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
|
||||||
self.session.add_extension(lt.create_ut_metadata_plugin)
|
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
|
||||||
self.session.add_extension(lt.create_smart_ban_plugin)
|
# self.session.add_extension(lt.create_metadata_plugin)
|
||||||
|
# self.session.add_extension(lt.create_ut_metadata_plugin)
|
||||||
|
# self.session.add_extension(lt.create_smart_ban_plugin)
|
||||||
|
|
||||||
# Create the components
|
# Create the components
|
||||||
self.eventmanager = EventManager()
|
self.eventmanager = EventManager()
|
||||||
|
|
|
@ -288,7 +288,10 @@ class PreferencesManager(component.Component):
|
||||||
def _on_set_utpex(self, key, value):
|
def _on_set_utpex(self, key, value):
|
||||||
log.debug("utpex value set to %s", value)
|
log.debug("utpex value set to %s", value)
|
||||||
if value:
|
if value:
|
||||||
self.session.add_extension(lt.create_ut_pex_plugin)
|
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
|
||||||
|
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
|
||||||
|
#self.session.add_extension(lt.create_ut_pex_plugin)
|
||||||
|
pass
|
||||||
|
|
||||||
def _on_set_enc_in_policy(self, key, value):
|
def _on_set_enc_in_policy(self, key, value):
|
||||||
self._on_set_encryption(key, value)
|
self._on_set_encryption(key, value)
|
||||||
|
|
Loading…
Reference in New Issue