Browse Source

ssh: handle ^C and ^D

Sergey Alirzaev 5 years ago
parent
commit
476f481155
1 changed files with 3 additions and 0 deletions
  1. 3 0
      modules/SSH_Server/server.c

+ 3 - 0
modules/SSH_Server/server.c

@@ -180,6 +180,9 @@ static void *server_worker(void* vArgs)
 
             if (rxSz > 0) {
                 cli_getchar(cli_states + threadCtx->fd, buf[0]);    // TODO handle rxSz > 1
+                if (buf[0] == 3 || buf[0] == 4) {
+                    stop = 1;
+                }
             } else {
                 stop = 1;
             }