From: Stefan Eissing Date: Fri, 28 Nov 2025 13:05:34 +0000 (+0100) Subject: libssh: fix state machine loop to progress as it should X-Git-Tag: rc-8_18_0-1~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b06cd929bd9bdda2fe4dfced73a60bd503be6155;p=thirdparty%2Fcurl.git libssh: fix state machine loop to progress as it should --- diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 2b605e4a61..d0f3d3de5c 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -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