From 96fdbe5238ac3afb341b92ea8f790f56ae5d7865 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 22 Sep 2026 10:55:57 -0700 Subject: [PATCH] apps, examples: keep readPeer up on a held reply A held status from wolfSSH_AGENT_RelayChannel() is negative, and leaving it in ret ended the outer while (ret >= 0) loop before the owed reply was retried. Reset ret to WS_SUCCESS when the reply is held so readPeer() returns to select() and retries it. Issue: F-10545 --- apps/wolfssh/wolfssh.c | 7 +++++-- examples/client/client.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/wolfssh/wolfssh.c b/apps/wolfssh/wolfssh.c index 79d84cd4..409903e2 100644 --- a/apps/wolfssh/wolfssh.c +++ b/apps/wolfssh/wolfssh.c @@ -737,9 +737,12 @@ static THREAD_RET readPeer(void* in) bytes = 0; } /* Back to select(), which is where the owed reply is - * retried. */ - if (agentOwed) + * retried. A held status is not an error, so keep the + * outer loop alive. */ + if (agentOwed) { + ret = WS_SUCCESS; bytes = 0; + } continue; } #endif /* WOLFSSH_AGENT */ diff --git a/examples/client/client.c b/examples/client/client.c index 04765c52..869ae54a 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -562,9 +562,12 @@ static THREAD_RET readPeer(void* in) break; } /* Back to select(), which is where the owed reply - * is retried. */ - if (agentOwed) + * is retried. A held status is not an error, so + * keep the outer loop alive. */ + if (agentOwed) { + ret = WS_SUCCESS; bytes = 0; + } continue; } #endif /* WOLFSSH_AGENT */