瀏覽代碼

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

Sergey Alirzaev 5 年之前
父節點
當前提交
d93a7492f5
共有 1 個文件被更改,包括 3 次插入2 次删除
  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;