mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Fix for an Issue #591
This commit is contained in:
parent
854a55166c
commit
0b4fcb6845
|
@ -187,8 +187,11 @@ class Task(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def engine_get_returncode(self):
|
def engine_get_returncode(self):
|
||||||
|
if self.process:
|
||||||
self.process.poll()
|
self.process.poll()
|
||||||
return self.process.returncode
|
return self.process.returncode
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def engine_has_terminated(self):
|
def engine_has_terminated(self):
|
||||||
return isinstance(self.engine_get_returncode(), int)
|
return isinstance(self.engine_get_returncode(), int)
|
||||||
|
@ -510,6 +513,9 @@ def scan_status(taskid):
|
||||||
logger.warning("[%s] Invalid task ID provided to scan_status()" % taskid)
|
logger.warning("[%s] Invalid task ID provided to scan_status()" % taskid)
|
||||||
return jsonize({"success": False, "message": "Invalid task ID"})
|
return jsonize({"success": False, "message": "Invalid task ID"})
|
||||||
|
|
||||||
|
if DataStore.tasks[taskid].engine_get_returncode() is None:
|
||||||
|
status = "not running"
|
||||||
|
else:
|
||||||
status = "terminated" if DataStore.tasks[taskid].engine_has_terminated() is True else "running"
|
status = "terminated" if DataStore.tasks[taskid].engine_has_terminated() is True else "running"
|
||||||
|
|
||||||
logger.debug("[%s] Retrieved scan status" % taskid)
|
logger.debug("[%s] Retrieved scan status" % taskid)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user