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.
This commit is contained in:
Mike Salvatore 2022-09-12 08:12:17 -04:00
parent 7ff61423dc
commit 191ee1a5f9
1 changed files with 1 additions and 1 deletions

View File

@ -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}")