diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-14 16:02:08 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-14 16:02:08 +0200 |
commit | e7c95267245d226f4966f055289b061dd1bc2f91 (patch) | |
tree | d8e537f9e4b838cbe0effc9763e652c8610642f8 /module/network | |
parent | fixes (diff) | |
download | pyload-e7c95267245d226f4966f055289b061dd1bc2f91.tar.xz |
more fixes
Diffstat (limited to 'module/network')
-rwxr-xr-x | module/network/Request.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/network/Request.py b/module/network/Request.py index f9941d74c..c76590afc 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -126,7 +126,7 @@ class Request: return None def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, no_post_encode=False): - + self.pycurl.setopt(pycurl.NOPROGRESS, 1) url = self.__myquote(str(url)) @@ -144,7 +144,7 @@ class Request: get = "" self.pycurl.setopt(pycurl.URL, url) - self.pycurl.setopt(pycurl.WRITEFUNCTION, self.rep.write) + self.pycurl.setopt(pycurl.WRITEFUNCTION, self.write_rep) if cookies: self.curl_enable_cookies() @@ -333,6 +333,14 @@ class Request: def write_header(self, string): self.header += string + def write_rep(self, buf): + if self.rep.tell() > 180000 or self.abort: + if self.abort: raise Abort + print self.rep.getvalue() + raise Exception("Loaded Url exceeded limit") + + self.rep.write(buf) + def get_rep(self): value = self.rep.getvalue() self.rep.close() |