Merge pull request #578 from ejohnstown/nonblock-client

Nonblock Client Login Failure
pull/581/head
JacobBarthelmeh 2023-09-13 16:42:02 -06:00 committed by GitHub
commit e474af55b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -396,10 +396,14 @@ static THREAD_RET readPeer(void* in)
} while (ret > 0); } while (ret > 0);
} }
else if (ret <= 0) { else if (ret <= 0) {
#ifdef WOLFSSH_AGENT
if (ret == WS_FATAL_ERROR) { if (ret == WS_FATAL_ERROR) {
ret = wolfSSH_get_error(args->ssh); ret = wolfSSH_get_error(args->ssh);
if (ret == WS_CHAN_RXD) { if (ret == WS_WANT_READ) {
/* If WANT_READ, not an error. */
ret = WS_SUCCESS;
}
#ifdef WOLFSSH_AGENT
else if (ret == WS_CHAN_RXD) {
byte agentBuf[512]; byte agentBuf[512];
int rxd, txd; int rxd, txd;
word32 channel = 0; word32 channel = 0;
@ -430,9 +434,9 @@ static THREAD_RET readPeer(void* in)
WMEMSET(agentBuf, 0, sizeof(agentBuf)); WMEMSET(agentBuf, 0, sizeof(agentBuf));
continue; continue;
} }
#endif /* WOLFSSH_AGENT */
} }
#endif else if (ret != WS_EOF) {
if (ret != WS_EOF) {
err_sys("Stream read failed."); err_sys("Stream read failed.");
} }
} }