mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 10:28:39 +00:00
Fix to prevent Deluge from segfaulting when trying to autoadd an
incomplete torrent file
This commit is contained in:
parent
67b85a9f89
commit
73b3ff8a0f
2 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@ Deluge 0.9.07 - "1.0.0_RC7" (In Development)
|
||||||
Core:
|
Core:
|
||||||
* Fix loading torrents from state when fastresume file is missing
|
* Fix loading torrents from state when fastresume file is missing
|
||||||
* Fix UPnP
|
* Fix UPnP
|
||||||
|
* Fix to prevent Deluge from segfaulting when trying to autoadd an incomplete torrent file
|
||||||
|
|
||||||
GtkUI:
|
GtkUI:
|
||||||
* Add 'edit' to edit trackers dialog
|
* Add 'edit' to edit trackers dialog
|
||||||
|
|
|
@ -42,7 +42,7 @@ MAX_NUM_ATTEMPTS = 10
|
||||||
|
|
||||||
class AutoAdd(component.Component):
|
class AutoAdd(component.Component):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=3000)
|
component.Component.__init__(self, "AutoAdd", depend=["TorrentManager"], interval=5000)
|
||||||
# Get the core config
|
# Get the core config
|
||||||
self.config = ConfigManager("core.conf")
|
self.config = ConfigManager("core.conf")
|
||||||
|
|
||||||
|
@ -100,6 +100,8 @@ class AutoAdd(component.Component):
|
||||||
log.debug("Attempting to open %s for add.", filename)
|
log.debug("Attempting to open %s for add.", filename)
|
||||||
_file = open(filename, "rb")
|
_file = open(filename, "rb")
|
||||||
filedump = _file.read()
|
filedump = _file.read()
|
||||||
|
if not filedump:
|
||||||
|
raise RuntimeError, "Torrent is 0 bytes!"
|
||||||
_file.close()
|
_file.close()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
log.warning("Unable to open %s: %s", filename, e)
|
log.warning("Unable to open %s: %s", filename, e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue