Return dict object, not single None value
This commit is contained in:
parent
6318c0889a
commit
5d7b8cfd48
1 changed files with 3 additions and 5 deletions
|
@ -90,7 +90,7 @@ class FileServer(ConnectionServer):
|
|||
if not port:
|
||||
port = self.port
|
||||
back = self.testOpenportPortchecker(port)
|
||||
if back["result"] is not True and use_alternative: # If no success try alternative checker
|
||||
if (back["result"] is not True and use_alternative) or back["result"] is None: # If no success try alternative checker
|
||||
back = self.testOpenportCanyouseeme(port)
|
||||
|
||||
if self.ui_server:
|
||||
|
@ -143,8 +143,7 @@ class FileServer(ConnectionServer):
|
|||
message = re.match('.*<div id="results-wrapper">(.*?)</div>', data, re.DOTALL).group(1)
|
||||
message = re.sub("<.*?>", "", message.replace("<br>", " ").replace(" ", " ").strip()) # Strip http tags
|
||||
except Exception, err:
|
||||
self.log.info("portchecker.co down")
|
||||
return None
|
||||
return {"result": None, "message": Debug.formatException(err)}
|
||||
|
||||
if "open" not in message:
|
||||
if config.tor != "always":
|
||||
|
@ -177,8 +176,7 @@ class FileServer(ConnectionServer):
|
|||
message = re.match('.*<p style="padding-left:15px">(.*?)</p>', data, re.DOTALL).group(1)
|
||||
message = re.sub("<.*?>", "", message.replace("<br>", " ").replace(" ", " ")) # Strip http tags
|
||||
except Exception, err:
|
||||
self.log.info("canyouseeme.org down")
|
||||
return None
|
||||
return {"result": None, "message": Debug.formatException(err)}
|
||||
|
||||
if "Success" not in message:
|
||||
if config.tor != "always":
|
||||
|
|
Loading…
Reference in a new issue