diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-24 20:41:05 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-24 20:41:05 +0100 |
commit | 56931ba3fdf53dc2a82afc1cbdbe8d3ec2204be5 (patch) | |
tree | 19332c5bd7d56ef3c4b2ec42a9079997cffce6f2 /module/network | |
parent | fixed header and POST (diff) | |
download | pyload-56931ba3fdf53dc2a82afc1cbdbe8d3ec2204be5.tar.xz |
fixed reusing bad connection
Diffstat (limited to 'module/network')
-rw-r--r-- | module/network/HTTPBase.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/network/HTTPBase.py b/module/network/HTTPBase.py index 637d4ad7e..2737fd33c 100644 --- a/module/network/HTTPBase.py +++ b/module/network/HTTPBase.py @@ -21,21 +21,19 @@ from urllib import urlencode from urllib2 import Request from urllib2 import OpenerDirector - from urllib2 import HTTPHandler from urllib2 import HTTPSHandler from urllib2 import HTTPDefaultErrorHandler from urllib2 import HTTPErrorProcessor from urllib2 import ProxyHandler - from urllib2 import URLError - from urllib2 import _parse_proxy from httplib import HTTPConnection from httplib import HTTPResponse from httplib import responses as HTTPStatusCodes from httplib import ResponseNotReady +from httplib import BadStatusLine from CookieJar import CookieJar from CookieRedirectHandler import CookieRedirectHandler @@ -214,11 +212,14 @@ class PyLoadHTTPHandler(HTTPHandler): if not h is None: try: self._start_connection(h, req) - except socket.error, e: + except socket.error: + r = None + except BadStatusLine: r = None else: try: r = h.getresponse() - except ResponseNotReady, e: r = None + except ResponseNotReady: r = None + except BadStatusLine: r = None if r is None or r.version == 9: # httplib falls back to assuming HTTP 0.9 if it gets a |