diff options
author | Ryo Nakamura <upa@haeena.net> | 2022-12-03 20:48:43 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2022-12-03 20:48:43 +0900 |
commit | 3b794ab51b04cd82f84f5b820f57267695066d80 (patch) | |
tree | 2b490f895106da5fa3012f1765bd8bd894b97f12 /src/ssh.c | |
parent | 50c6781811c880fa98ab368c11e9c33d2804dbf8 (diff) |
remove unused code and introduce -b buf_sz option
This commit removes ifdef ASYNC_WRITE. So, mscp always depends on
the patched libssh.
Diffstat (limited to 'src/ssh.c')
-rw-r--r-- | src/ssh.c | 31 |
1 files changed, 1 insertions, 30 deletions
@@ -268,7 +268,7 @@ static int ssh_verify_known_hosts(ssh_session session) case SSH_KNOWN_HOSTS_UNKNOWN: hexa = ssh_get_hexa(hash, hlen); - fprintf(stderr,"The server is unknown. Do you trust the host key?\n"); + fprintf(stderr, "The server is unknown. Do you trust the host key?\n"); fprintf(stderr, "Public key hash: %s\n", hexa); fprintf(stderr, "(yes/no): "); ssh_string_free_char(hexa); @@ -310,32 +310,3 @@ void ssh_sftp_close(sftp_session sftp) ssh_disconnect(ssh); ssh_free(ssh); } - - -ssize_t sftp_write2(sftp_file sf, const void *buf, size_t len, size_t sftp_buf_sz) -{ - ssize_t ret, nbytes; - - for (nbytes = 0; nbytes < len;) { - ret = sftp_write(sf, buf + nbytes, - min(len - nbytes, sftp_buf_sz)); - if (ret < 0) - return ret; - nbytes += ret; - } - return nbytes; -} - -ssize_t sftp_read2(sftp_file sf, void *buf, size_t len, size_t sftp_buf_sz) -{ - ssize_t ret, nbytes; - - for (nbytes = 0; nbytes < len;) { - ret = sftp_read(sf, buf + nbytes, - min(len - nbytes, sftp_buf_sz)); - if (ret < 0) - return ret; - nbytes += ret; - } - return nbytes; -} |