From 191ee1a5f9bce114763d9c42901af843a286a904 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 12 Sep 2022 08:12:17 -0400 Subject: [PATCH] Agent: Change order of spawn pipe and add relay user If we were unsuccessful in starting the pipe, we don't want to sit around and wait for a relay user to connect. --- .../infection_monkey/network/relay/relay_connection_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/network/relay/relay_connection_handler.py b/monkey/infection_monkey/network/relay/relay_connection_handler.py index 9d081cf65..964a1121a 100644 --- a/monkey/infection_monkey/network/relay/relay_connection_handler.py +++ b/monkey/infection_monkey/network/relay/relay_connection_handler.py @@ -31,8 +31,8 @@ class RelayConnectionHandler: if control_message.startswith(RELAY_CONTROL_MESSAGE_REMOVE_FROM_WAITLIST): self._relay_user_handler.disconnect_user(addr) else: - self._relay_user_handler.add_relay_user(addr) try: self._pipe_spawner.spawn_pipe(sock) + self._relay_user_handler.add_relay_user(addr) except OSError as err: logger.debug(f"Failed to spawn pipe: {err}")