]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh: fix state machine loop to progress as it should
authorStefan Eissing <stefan@eissing.org>
Fri, 28 Nov 2025 13:05:34 +0000 (14:05 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 28 Nov 2025 15:05:52 +0000 (16:05 +0100)
lib/vssh/libssh.c

index 2b605e4a61840c0ed858c24382c05f8502762bd8..d0f3d3de5cca21d0cfb1af5ddfdfbf945568af33 100644 (file)
@@ -2408,7 +2408,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
       break;
 
     }
-  } while(!rc && (sshc->state != SSH_STOP));
+    /* break the loop only on STOP or SSH_AGAIN. If `rc` is some
+     * other error code, we will have progressed the state accordingly. */
+  } while((rc != SSH_AGAIN) && (sshc->state != SSH_STOP));
 
   if(rc == SSH_AGAIN) {
     /* we would block, we need to wait for the socket to be ready (in the