SFTP_SendReadPacket() can return a 0 in normal situations. SFTP_Get()

was treating it like an error and skipping the file close.
pull/134/head
John Safranek 2019-01-07 11:50:15 -08:00
parent c91dc02336
commit 9d589ea769
1 changed files with 1 additions and 1 deletions

View File

@ -5969,7 +5969,7 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from,
state->handle, state->handleSz,
state->gOfst, state->r,
WOLFSSH_MAX_SFTP_RW);
if (sz <= 0) {
if (sz < 0) {
if (ssh->error == WS_WANT_READ ||
ssh->error == WS_WANT_WRITE) {
return WS_FATAL_ERROR;