diff options
author | mkaay <mkaay@mkaay.de> | 2009-11-12 23:33:28 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-11-12 23:33:28 +0100 |
commit | d15f1d61c74dec1b566eb5d8b312f0b2c9eefd99 (patch) | |
tree | d43555ce368bbe8fc9f8d96482ffb57b86ead2f0 /module/network | |
parent | better exception handling for sockets (diff) | |
download | pyload-d15f1d61c74dec1b566eb5d8b312f0b2c9eefd99.tar.xz |
config includes max download time
Diffstat (limited to 'module/network')
-rwxr-xr-x | module/network/Request.py | 6 |
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) |