feature: Add support for getting inbound connection.

Also fixes any bugs I found.
This commit is contained in:
greysoh 2024-05-07 18:35:04 -04:00
parent b99d6a89dc
commit a9fcdea037
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
8 changed files with 146 additions and 17 deletions

View file

@ -35,7 +35,7 @@ export class SSHCommand extends Command {
if (process.env.NODE_ENV != "production") {
println(
"Caught irrecoverable action (command help call) in patchCommander\n",
"Caught irrecoverable crash (command help call) in patchCommander\n",
);
} else {
println("Aborted\n");
@ -46,12 +46,22 @@ export class SSHCommand extends Command {
}
}
_exit() {
recvExitDispatch() {
this.hasRecievedExitSignal = true;
let parentElement = this.parent;
while (parentElement instanceof SSHCommand) {
parentElement.hasRecievedExitSignal = true;
parentElement = parentElement.parent;
};
}
_exit() {
this.recvExitDispatch();
}
_exitCallback() {
this.hasRecievedExitSignal = true;
this.recvExitDispatch();
}
action(fn: (...args: any[]) => void | Promise<void>): this {
@ -63,7 +73,7 @@ export class SSHCommand extends Command {
// @ts-ignore
this._actionHandler = async (...args: any[]): Promise<void> => {
if (args[0][0] == "--help" || args[0][0] == "-h") return;
if (this.hasRecievedExitSignal) return;
await oldActionHandler(...args);
};