forked from p15670423/monkey
Limit monkey lookup in find_server.
Prevents a situation where the Monkey attempts to connect to a server, but it's not accessible over the regular port but requires a tunnel. However the Monkey on the other side will quit before getting the tunnel request because the isolated monkey is waiting forever
This commit is contained in:
parent
f39ee62668
commit
a44e9a901f
|
@ -19,6 +19,9 @@ requests.packages.urllib3.disable_warnings()
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
DOWNLOAD_CHUNK = 1024
|
DOWNLOAD_CHUNK = 1024
|
||||||
|
# random number greater than 5,
|
||||||
|
# to prevent the monkey from just waiting forever to try and connect to an island before going elsewhere.
|
||||||
|
TIMEOUT = 9
|
||||||
|
|
||||||
|
|
||||||
class ControlClient(object):
|
class ControlClient(object):
|
||||||
|
@ -72,7 +75,8 @@ class ControlClient(object):
|
||||||
LOG.debug(debug_message)
|
LOG.debug(debug_message)
|
||||||
requests.get("https://%s/api?action=is-up" % (server,),
|
requests.get("https://%s/api?action=is-up" % (server,),
|
||||||
verify=False,
|
verify=False,
|
||||||
proxies=ControlClient.proxies)
|
proxies=ControlClient.proxies,
|
||||||
|
timeout=TIMEOUT)
|
||||||
WormConfiguration.current_server = current_server
|
WormConfiguration.current_server = current_server
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue