better handling of window full cases with SFTP

pull/530/head
JacobBarthelmeh 2023-06-26 22:58:28 -07:00
parent b17f73a585
commit 049e40bb1c
2 changed files with 11 additions and 1 deletions

View File

@ -579,6 +579,14 @@ static int SFTP_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
timeout = TEST_SFTP_TIMEOUT;
continue;
}
if (error == WS_WANT_READ || error == WS_WANT_WRITE ||
error == WS_WINDOW_FULL) {
timeout = TEST_SFTP_TIMEOUT;
ret = error;
continue;
}
if (error == WS_EOF) {
break;
}
@ -598,8 +606,9 @@ static int SFTP_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
error == WS_CHAN_RXD || error == WS_REKEYING ||
error == WS_WINDOW_FULL)
ret = error;
if (error == WS_EOF)
if (error == WS_EOF) {
break;
}
continue;
}

View File

@ -12421,6 +12421,7 @@ int SendChannelData(WOLFSSH* ssh, word32 channelId,
if (ret == WS_SUCCESS) {
if (channel->peerWindowSz == 0) {
WLOG(WS_LOG_DEBUG, "channel window is full");
ssh->error = WS_WINDOW_FULL;
ret = WS_WINDOW_FULL;
}
}