Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8a5a54

Browse files
committed
minor update
1 parent 4984cea commit b8a5a54

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/request/connect.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ def getPage(**kwargs):
202202
page = e.read()
203203
responseHeaders = e.info()
204204
except socket.timeout:
205-
page, responseHeaders = None, None
206205
warnMsg = "connection timed out while trying "
207206
warnMsg += "to get error page information (%d)" % e.code
208207
logger.warn(warnMsg)
209-
210208
return None, None
211209

212210
code = e.code

lib/utils/google.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ def search(self, googleDork):
129129

130130
logger.log(8, responseMsg)
131131
except urllib2.HTTPError, e:
132-
page = e.read()
132+
try:
133+
page = e.read()
134+
except socket.timeout:
135+
warnMsg = "connection timed out while trying "
136+
warnMsg += "to get error page information (%d)" % e.code
137+
logger.warn(warnMsg)
138+
return None
133139
except (urllib2.URLError, socket.error, socket.timeout), e:
134140
errMsg = "unable to connect to Google"
135141
raise sqlmapConnectionException, errMsg

0 commit comments

Comments
 (0)