summaryrefslogtreecommitdiff
path: root/lib/thandy/download.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-03-19 12:11:49 -0400
committerNick Mathewson <nickm@torproject.org>2009-03-19 12:11:49 -0400
commitb6b677c18061ba87494e59b8fedd721988eb5b6c (patch)
treea668241cb59a543b54872a976de711807c6069e6 /lib/thandy/download.py
parent714d37da91c34db5911e413d53ab544f7ef5a9a3 (diff)
Actually enforce file lengths when downloading.
Most of the code was already written for this, but we didn't actually pass the length fields we'd parsed to the downloading logic.
Diffstat (limited to 'lib/thandy/download.py')
-rw-r--r--lib/thandy/download.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/thandy/download.py b/lib/thandy/download.py
index f715a23..d5f1629 100644
--- a/lib/thandy/download.py
+++ b/lib/thandy/download.py
@@ -542,9 +542,11 @@ class SimpleDownloadJob(DownloadJob):
"""Testing subtype of DownloadJob: just downloads a URL and writes it to
disk."""
def __init__(self, targetPath, url,
- wantHash=None, supportedURLTypes=None, useTor=False):
+ wantHash=None, supportedURLTypes=None, useTor=False,
+ wantLength=None):
DownloadJob.__init__(self, targetPath, targetPath+".tmp",
wantHash=wantHash,
+ wantLength=length,
useTor=useTor)
self._url = url
@@ -579,9 +581,10 @@ class ThandyDownloadJob(DownloadJob):
and Thandy's directory structure."""
def __init__(self, relPath, destPath, mirrorList, wantHash=None,
supportedURLTypes=None, useTor=None, repoFile=None,
- downloadStatusLog=None):
+ downloadStatusLog=None, wantLength=None):
DownloadJob.__init__(self, destPath, None, wantHash=wantHash,
+ wantLength=wantLength,
useTor=useTor, repoFile=repoFile)
self._mirrorList = mirrorList
self._relPath = relPath