mirror of https://github.com/wolfSSL/wolfssh.git
SFTP Fix
1. Remove the continue from the SFTP worker loop when there's a timeout on the select and when there's a want_read from the wolfSSH_worker. 2. When the select has receive data ready, check it. Don't make it conditional on want read as well. The goal is that when there isn't data waiting on the socket, check and process the data in the SFTP channel's buffer, always.pull/667/head
parent
c07a86856e
commit
76e8d66289
|
@ -1196,11 +1196,8 @@ static int sftp_worker(thread_ctx_t* threadCtx)
|
||||||
}
|
}
|
||||||
else if (selected == WS_SELECT_TIMEOUT) {
|
else if (selected == WS_SELECT_TIMEOUT) {
|
||||||
timeout = TEST_SFTP_TIMEOUT_LONG;
|
timeout = TEST_SFTP_TIMEOUT_LONG;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else if (selected == WS_SELECT_RECV_READY) {
|
||||||
if (ret == WS_WANT_READ || ret == WS_WANT_WRITE ||
|
|
||||||
selected == WS_SELECT_RECV_READY) {
|
|
||||||
ret = wolfSSH_worker(ssh, NULL);
|
ret = wolfSSH_worker(ssh, NULL);
|
||||||
error = wolfSSH_get_error(ssh);
|
error = wolfSSH_get_error(ssh);
|
||||||
if (ret == WS_REKEYING) {
|
if (ret == WS_REKEYING) {
|
||||||
|
@ -1213,7 +1210,6 @@ static int sftp_worker(thread_ctx_t* threadCtx)
|
||||||
error == WS_WINDOW_FULL) {
|
error == WS_WINDOW_FULL) {
|
||||||
timeout = TEST_SFTP_TIMEOUT;
|
timeout = TEST_SFTP_TIMEOUT;
|
||||||
ret = error;
|
ret = error;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error == WS_EOF) {
|
if (error == WS_EOF) {
|
||||||
|
|
Loading…
Reference in New Issue