From e5caabadeda34cb8a0ef7ae1717e781c3dcce8e2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 29 Sep 2020 07:47:29 +0100 Subject: [PATCH] psusan: terminate when the session is concluded. I carefully set a 'finished' flag in the main source file on receipt of the server_instance_terminated() callback, and then I plain forgot to hook it up to the uxcliloop callback that says whether the program should carry on running each time round the main loop. Now we actually check the finished flag, and terminate the program if it's set. --- unix/uxpsusan.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unix/uxpsusan.c b/unix/uxpsusan.c index 5f32bfad..59de0a9a 100644 --- a/unix/uxpsusan.c +++ b/unix/uxpsusan.c @@ -160,6 +160,11 @@ void server_instance_terminated(LogPolicy *lp) sfree(inst); } +bool psusan_continue(void *ctx, bool fd, bool cb) +{ + return !finished; +} + static bool longoptarg(const char *arg, const char *expected, const char **val, int *argcp, char ***argvp) { @@ -299,7 +304,7 @@ int main(int argc, char **argv) ssh_server_start(plug, make_fd_socket(0, 1, -1, plug)); cli_main_loop(cliloop_no_pw_setup, cliloop_no_pw_check, - cliloop_always_continue, NULL); + psusan_continue, NULL); return 0; }