]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssh: retrieve the error using wolfSSH_get_error
authorJoseph Chen <joseph@baoruh.com.tw>
Fri, 14 Feb 2025 13:53:51 +0000 (21:53 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 15 Feb 2025 21:20:15 +0000 (22:20 +0100)
Closes #16335

lib/vssh/wolfssh.c

index d038ccd26ee8aaec84c331e23f44f09e85360f56..4c6a609f48d2b409f067e01efb9bd60a77ff1e4b 100644 (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;