mirror of https://github.com/wolfSSL/wolfssh.git
reset want read before attempting to read
parent
067cc069aa
commit
bd1506db93
|
@ -158,6 +158,7 @@ static int NonBlockSSH_connect(WOLFSSH* ssh)
|
||||||
select_ret == WS_SELECT_ERROR_READY)
|
select_ret == WS_SELECT_ERROR_READY)
|
||||||
{
|
{
|
||||||
ret = wolfSSH_connect(ssh);
|
ret = wolfSSH_connect(ssh);
|
||||||
|
error = wolfSSH_get_error(ssh);
|
||||||
}
|
}
|
||||||
else if (select_ret == WS_SELECT_TIMEOUT)
|
else if (select_ret == WS_SELECT_TIMEOUT)
|
||||||
error = WS_WANT_READ;
|
error = WS_WANT_READ;
|
||||||
|
|
|
@ -2264,8 +2264,14 @@ static int GetInputData(WOLFSSH* ssh, word32 size)
|
||||||
|
|
||||||
/* Take into account the data already in the buffer. Update size
|
/* Take into account the data already in the buffer. Update size
|
||||||
* for what is missing in the request. */
|
* for what is missing in the request. */
|
||||||
word32 haveDataSz = ssh->inputBuffer.length - ssh->inputBuffer.idx;
|
word32 haveDataSz;
|
||||||
|
|
||||||
|
/* reset want read state before attempting to read */
|
||||||
|
if (ssh->error == WS_WANT_READ) {
|
||||||
|
ssh->error = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
haveDataSz = ssh->inputBuffer.length - ssh->inputBuffer.idx;
|
||||||
if (haveDataSz >= size) {
|
if (haveDataSz >= size) {
|
||||||
WLOG(WS_LOG_INFO, "GID: have enough already, return early");
|
WLOG(WS_LOG_INFO, "GID: have enough already, return early");
|
||||||
return WS_SUCCESS;
|
return WS_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue