diff --git a/lib/request/connect.py b/lib/request/connect.py index 046a7d837..44e1ef7a9 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -202,11 +202,9 @@ class Connect: page = e.read() responseHeaders = e.info() except socket.timeout: - page, responseHeaders = None, None warnMsg = "connection timed out while trying " warnMsg += "to get error page information (%d)" % e.code logger.warn(warnMsg) - return None, None code = e.code diff --git a/lib/utils/google.py b/lib/utils/google.py index efb72af62..61d1b3695 100644 --- a/lib/utils/google.py +++ b/lib/utils/google.py @@ -129,7 +129,13 @@ class Google: logger.log(8, responseMsg) except urllib2.HTTPError, e: - page = e.read() + try: + page = e.read() + except socket.timeout: + warnMsg = "connection timed out while trying " + warnMsg += "to get error page information (%d)" % e.code + logger.warn(warnMsg) + return None except (urllib2.URLError, socket.error, socket.timeout), e: errMsg = "unable to connect to Google" raise sqlmapConnectionException, errMsg