diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index dfc70582..a4fb7a57 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -459,6 +459,10 @@ def conserver_command(filehandle, command): if command[0] == '.': print("disconnect]\r") quitconfetty(fullexit=consoleonly) + elif command[0] == 'o': + tlvdata.send(session.connection, {'operation': 'reopen', + 'path': currconsole}) + print('reopen]\r') elif command[0] == 'b': tlvdata.send(session.connection, {'operation': 'break', 'path': currconsole}) @@ -467,6 +471,7 @@ def conserver_command(filehandle, command): print("help]\r") print(". disconnect\r") print("b break\r") + print("o reopen\r") print(" abort command\r") elif command[0] == '\x0d': print("ignored]\r") diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index bc95ab7c..c451ca8c 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -286,6 +286,9 @@ class _ConsoleHandler(object): logdata=username, ltype=log.DataTypes.event, event=log.Events.clientdisconnect, eventdata=edata) + def reopen(self): + self._got_disconnected() + def _handle_console_output(self, data): if type(data) == int: if data == conapi.ConsoleEvent.Disconnect: @@ -440,6 +443,9 @@ class ConsoleSession(object): def send_break(self): self.conshdl.send_break() + def reopen(self): + self.conshdl.reopen() + def destroy(self): _handled_consoles[self.ckey].detachuser(self.username) _handled_consoles[self.ckey].unregister_rcpt(self.reghdl) diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index c4e80a69..4e3b9b7f 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -172,6 +172,9 @@ def process_request(connection, request, cfm, authdata, authname, skipauth): elif data['operation'] == 'break': consession.send_break() continue + elif data['operation'] == 'reopen': + consession.reopen() + continue else: raise Exception("TODO") if not data: