wolfssh: retrieve the error using wolfSSH_get_error

Closes #16335
This commit is contained in:
Joseph Chen 2025-02-14 21:53:51 +08:00 committed by Daniel Stenberg
parent 2ee754d830
commit 63197b7ff2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -809,11 +809,15 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block)
break;
}
case SSH_SFTP_CLOSE:
if(sshc->handleSz)
if(sshc->handleSz) {
rc = wolfSSH_SFTP_Close(sshc->ssh_session, sshc->handle,
sshc->handleSz);
else
if(rc != WS_SUCCESS)
rc = wolfSSH_get_error(sshc->ssh_session);
}
else {
rc = WS_SUCCESS; /* directory listing */
}
if(rc == WS_WANT_READ) {
*block = TRUE;
conn->waitfor = KEEP_RECV;