Skip to content

Commit 9ac2511

Browse files
committed
Minor refactoring
1 parent c712e9c commit 9ac2511

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.5.10.1"
23+
VERSION = "1.5.10.2"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from lib.core.data import paths
3232
from lib.core.data import queries
3333
from lib.core.patch import unisonRandom
34-
from lib.core.settings import MAX_CONSECUTIVE_CONNECTION_ERRORS
3534
from lib.core.settings import IS_WIN
3635

3736
def vulnTest():
@@ -97,28 +96,27 @@ def _thread():
9796
vulnserver.init(quiet=True)
9897
vulnserver.run(address=address, port=port)
9998

99+
vulnserver._alive = True
100+
100101
thread = threading.Thread(target=_thread)
101102
thread.daemon = True
102103
thread.start()
103104

104-
success = False
105-
for i in xrange(MAX_CONSECUTIVE_CONNECTION_ERRORS):
105+
while vulnserver._alive:
106106
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
107107
try:
108108
s.connect((address, port))
109109
s.send(b"GET / HTTP/1.0\r\n\r\n")
110110
if b"vulnserver" in s.recv(4096):
111-
success = True
112111
break
113112
except:
114113
pass
115114
finally:
116115
s.close()
117-
if not success:
118-
time.sleep(1)
116+
time.sleep(1)
119117

120-
if not success:
121-
logger.error("problem occurred in vulnserver instantiation (address: 'http://%s:%s', alive: %s)" % (address, port, vulnserver._alive))
118+
if not vulnserver._alive:
119+
logger.error("problem occurred in vulnserver instantiation (address: 'http://%s:%s')" % (address, port))
122120
return False
123121
else:
124122
logger.info("vulnserver running at 'http://%s:%s'..." % (address, port))

0 commit comments

Comments
 (0)