summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-20 12:57:26 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-20 12:57:26 +0200
commit702ab35e37437300a2ded26e66011faaac06f902 (patch)
treec8fc2eb69a3838c7c41e35d3ce75423f4ccee1c2 /module/network
parent[Ftp] Improve __pattern__ (diff)
downloadpyload-702ab35e37437300a2ded26e66011faaac06f902.tar.xz
Fix download resume feature
Diffstat (limited to 'module/network')
-rw-r--r--module/network/HTTPDownload.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py
index fe8075539..3f32295b4 100644
--- a/module/network/HTTPDownload.py
+++ b/module/network/HTTPDownload.py
@@ -63,7 +63,7 @@ class HTTPDownload():
except IOError:
self.info = ChunkInfo(filename)
- self.chunkSupport = None
+ self.chunkSupport = True
self.m = pycurl.CurlMulti()
#needed for speed calculation
@@ -130,7 +130,7 @@ class HTTPDownload():
except pycurl.error, e:
#code 33 - no resume
code = e.args[0]
- if code == 33:
+ if resume is True and code == 33:
# try again without resume
self.log.debug("Errno 33 -> Restart without resume")
@@ -151,6 +151,7 @@ class HTTPDownload():
if not resume:
self.info.clear()
self.info.addChunk("%s.chunk0" % self.filename, (0, 0)) #create an initial entry
+ self.info.save()
self.chunks = []
@@ -164,8 +165,8 @@ class HTTPDownload():
chunksDone = set() # list of curl handles that are finished
chunksCreated = False
done = False
- if self.info.getCount() > 1: # This is a resume, if we were chunked originally assume still can
- self.chunkSupport = True
+ if self.info.getCount() is 0: # This is a resume, if we were chunked originally assume still can
+ self.chunkSupport = False
while 1:
#need to create chunks