summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-11-12 23:33:28 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-11-12 23:33:28 +0100
commitd15f1d61c74dec1b566eb5d8b312f0b2c9eefd99 (patch)
treed43555ce368bbe8fc9f8d96482ffb57b86ead2f0 /module/network
parentbetter exception handling for sockets (diff)
downloadpyload-d15f1d61c74dec1b566eb5d8b312f0b2c9eefd99.tar.xz
config includes max download time
Diffstat (limited to 'module/network')
-rwxr-xr-xmodule/network/Request.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index 37837fcaa..985abe8e9 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -49,6 +49,8 @@ class Request:
self.lastURL = None
self.auth = False
+
+ self.timeout = 5*3600
try:
if pycurl: self.curl = True
@@ -81,6 +83,8 @@ class Request:
("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"),
("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7")]
+ def set_timeout(self, timeout):
+ self.timeout = timeout
def init_curl(self):
self.rep = StringIO()
@@ -89,7 +93,7 @@ class Request:
self.pycurl = pycurl.Curl()
self.pycurl.setopt(pycurl.FOLLOWLOCATION, 1)
self.pycurl.setopt(pycurl.MAXREDIRS, 5)
- self.pycurl.setopt(pycurl.TIMEOUT, 5*3600)
+ self.pycurl.setopt(pycurl.TIMEOUT, self.timeout)
self.pycurl.setopt(pycurl.CONNECTTIMEOUT, 30)
self.pycurl.setopt(pycurl.NOSIGNAL, 1)
self.pycurl.setopt(pycurl.NOPROGRESS, 0)