mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +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
|
||||
|
||||
def engine_get_returncode(self):
|
||||
if self.process:
|
||||
self.process.poll()
|
||||
return self.process.returncode
|
||||
else:
|
||||
return None
|
||||
|
||||
def engine_has_terminated(self):
|
||||
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)
|
||||
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"
|
||||
|
||||
logger.debug("[%s] Retrieved scan status" % taskid)
|
||||
|
|
Loading…
Reference in New Issue
Block a user