minor update

This commit is contained in:
Miroslav Stampar 2010-05-15 20:44:08 +00:00
parent 4984ceac49
commit b8a5a54395
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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