mirror of
https://github.com/curl/curl.git
synced 2026-07-26 17:37:16 +03:00
parent
080973dcdb
commit
cd2b45201a
32 changed files with 68 additions and 75 deletions
|
|
@ -695,7 +695,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
case SSH_S_STARTUP:
|
||||
rc = ssh_connect(sshc->ssh_session);
|
||||
|
||||
myssh_block2waitfor(conn, (rc == SSH_AGAIN) ? TRUE : FALSE);
|
||||
myssh_block2waitfor(conn, (rc == SSH_AGAIN));
|
||||
if(rc == SSH_AGAIN) {
|
||||
DEBUGF(infof(data, "ssh_connect -> EAGAIN"));
|
||||
break;
|
||||
|
|
@ -2085,7 +2085,7 @@ static CURLcode myssh_multi_statemach(struct Curl_easy *data,
|
|||
implementation */
|
||||
CURLcode result = myssh_statemach_act(data, &block);
|
||||
|
||||
*done = (sshc->state == SSH_STOP) ? TRUE : FALSE;
|
||||
*done = (sshc->state == SSH_STOP);
|
||||
myssh_block2waitfor(conn, block);
|
||||
|
||||
return result;
|
||||
|
|
@ -2415,7 +2415,7 @@ static ssize_t scp_send(struct Curl_easy *data, int sockindex,
|
|||
/* The following code is misleading, mostly added as wishful thinking
|
||||
* that libssh at some point will implement non-blocking ssh_scp_write/read.
|
||||
* Currently rc can only be number of bytes read or SSH_ERROR. */
|
||||
myssh_block2waitfor(conn, (rc == SSH_AGAIN) ? TRUE : FALSE);
|
||||
myssh_block2waitfor(conn, (rc == SSH_AGAIN));
|
||||
|
||||
if(rc == SSH_AGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
@ -2447,7 +2447,7 @@ static ssize_t scp_recv(struct Curl_easy *data, int sockindex,
|
|||
* that libssh at some point will implement non-blocking ssh_scp_write/read.
|
||||
* Currently rc can only be SSH_OK or SSH_ERROR. */
|
||||
|
||||
myssh_block2waitfor(conn, (nread == SSH_AGAIN) ? TRUE : FALSE);
|
||||
myssh_block2waitfor(conn, (nread == SSH_AGAIN));
|
||||
if(nread == SSH_AGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
nread = -1;
|
||||
|
|
@ -2614,7 +2614,7 @@ static ssize_t sftp_recv(struct Curl_easy *data, int sockindex,
|
|||
mem, (uint32_t)len,
|
||||
(uint32_t)conn->proto.sshc.sftp_file_index);
|
||||
|
||||
myssh_block2waitfor(conn, (nread == SSH_AGAIN) ? TRUE : FALSE);
|
||||
myssh_block2waitfor(conn, (nread == SSH_AGAIN));
|
||||
|
||||
if(nread == SSH_AGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
|
|||
|
|
@ -3067,7 +3067,7 @@ static CURLcode ssh_multi_statemach(struct Curl_easy *data, bool *done)
|
|||
implementation */
|
||||
do {
|
||||
result = ssh_statemachine(data, &block);
|
||||
*done = (sshc->state == SSH_STOP) ? TRUE : FALSE;
|
||||
*done = (sshc->state == SSH_STOP);
|
||||
/* if there is no error, it is not done and it did not EWOULDBLOCK, then
|
||||
try again */
|
||||
} while(!result && !*done && !block);
|
||||
|
|
@ -3512,7 +3512,7 @@ static ssize_t scp_send(struct Curl_easy *data, int sockindex,
|
|||
/* libssh2_channel_write() returns int! */
|
||||
nwrite = (ssize_t) libssh2_channel_write(sshc->ssh_channel, mem, len);
|
||||
|
||||
ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
|
||||
ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN));
|
||||
|
||||
if(nwrite == LIBSSH2_ERROR_EAGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
@ -3537,7 +3537,7 @@ static ssize_t scp_recv(struct Curl_easy *data, int sockindex,
|
|||
/* libssh2_channel_read() returns int */
|
||||
nread = (ssize_t) libssh2_channel_read(sshc->ssh_channel, mem, len);
|
||||
|
||||
ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
|
||||
ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN));
|
||||
if(nread == LIBSSH2_ERROR_EAGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
nread = -1;
|
||||
|
|
@ -3650,7 +3650,7 @@ static ssize_t sftp_send(struct Curl_easy *data, int sockindex,
|
|||
|
||||
nwrite = libssh2_sftp_write(sshc->sftp_handle, mem, len);
|
||||
|
||||
ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
|
||||
ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN));
|
||||
|
||||
if(nwrite == LIBSSH2_ERROR_EAGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
@ -3678,7 +3678,7 @@ static ssize_t sftp_recv(struct Curl_easy *data, int sockindex,
|
|||
|
||||
nread = libssh2_sftp_read(sshc->sftp_handle, mem, len);
|
||||
|
||||
ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
|
||||
ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN));
|
||||
|
||||
if(nread == LIBSSH2_ERROR_EAGAIN) {
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
|
|||
|
|
@ -908,7 +908,7 @@ static CURLcode wssh_multi_statemach(struct Curl_easy *data, bool *done)
|
|||
implementation */
|
||||
do {
|
||||
result = wssh_statemach_act(data, &block);
|
||||
*done = (sshc->state == SSH_STOP) ? TRUE : FALSE;
|
||||
*done = (sshc->state == SSH_STOP);
|
||||
/* if there is no error, it is not done and it did not EWOULDBLOCK, then
|
||||
try again */
|
||||
if(*done) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue