From ab979865aa8f3d42d735846141d8b4def2596f61 Mon Sep 17 00:00:00 2001 From: Yosuke Shimizu Date: Wed, 2 Sep 2026 17:40:14 +0900 Subject: [PATCH] apps, examples: tolerate a worker want-write - The echoserver and Espressif shell loops and the Windows wolfsshd shell loop treat a WS_WANT_WRITE from wolfSSH_worker() as non-fatal. --- apps/wolfsshd/wolfsshd.c | 2 +- examples/echoserver/echoserver.c | 2 +- .../ESP-IDF/examples/wolfssh_echoserver/main/echoserver.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wolfsshd/wolfsshd.c b/apps/wolfsshd/wolfsshd.c index 07e6f9da..3e6d9eda 100644 --- a/apps/wolfsshd/wolfsshd.c +++ b/apps/wolfsshd/wolfsshd.c @@ -2296,7 +2296,7 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh, * peer. Both want fixing where they can be tested. */ continue; } - else if (rc != WS_WANT_READ) { + else if (rc != WS_WANT_READ && rc != WS_WANT_WRITE) { break; } } diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 435cec47..330a3017 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -1243,7 +1243,7 @@ static int ssh_worker(thread_ctx_t* threadCtx) * above, which has already run this pass. */ continue; } - else if (rc != WS_WANT_READ) { + else if (rc != WS_WANT_READ && rc != WS_WANT_WRITE) { #ifdef SHELL_DEBUG printf("Break:read sshFd returns %d: errno =%x\n", cnt_r, errno); diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/echoserver.c b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/echoserver.c index 835cf670..be688c62 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/echoserver.c +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/echoserver.c @@ -1170,7 +1170,7 @@ static int ssh_worker(thread_ctx_t* threadCtx) * above, which has already run this pass. */ continue; } - else if (rc != WS_WANT_READ) { + else if (rc != WS_WANT_READ && rc != WS_WANT_WRITE) { #ifdef SHELL_DEBUG printf("Break:read sshFd returns %d: errno =%x\n", cnt_r, errno);