Browse Source

ssh: don't accept a new client if ssh is turned off

Sergey Alirzaev 5 năm trước cách đây
mục cha
commit
d93a7492f5
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      modules/SSH_Server/server.c

+ 3 - 2
modules/SSH_Server/server.c

@@ -144,8 +144,9 @@ static void *server_worker(void* vArgs)
         ret = NonBlockSSH_accept(threadCtx->ssh);
 
     cli_state_t *cli_state;
-    // create the new CLI context
-    if (ret == WS_SUCCESS) {
+    if (!sSettings.sSSH.SSHEnable) {
+        // kick the client out
+    } else if (ret == WS_SUCCESS) {
         if ((cli_state = alloc_state())) {
             cli_state->num_connect = threadCtx->ssh;
             cli_state->input_state = CLI_CMD;