mirror of https://github.com/wolfSSL/wolfssh.git
adjust read on SFTP get
parent
f0ba3a0849
commit
887b4fa3ba
|
@ -5135,6 +5135,10 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from,
|
|||
state->handle, state->handleSz,
|
||||
state->gOfst, state->r,
|
||||
WOLFSSH_MAX_SFTP_RW);
|
||||
if (wolfSSH_get_error(ssh) == WS_WANT_READ) {
|
||||
return WS_FATAL_ERROR;
|
||||
}
|
||||
|
||||
if (sz > 0) {
|
||||
if ((long)WFWRITE(state->r, 1,
|
||||
sz, state->fl) != sz) {
|
||||
|
@ -5148,7 +5152,7 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from,
|
|||
}
|
||||
}
|
||||
} while (sz > 0 && ssh->sftpInt == 0);
|
||||
if (ret != WS_SUCCESS) {
|
||||
if (sz < 0) {
|
||||
state->state = STATE_GET_CLEANUP;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue