1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-08 19:02:07 +03:00

add libssh2_scp_recv2 to support large (> 2GB) files on windows

This commit is contained in:
David Byron
2015-06-29 17:16:43 -07:00
committed by Alexander Lamaison
parent 4961014033
commit 6c84a426be
14 changed files with 167 additions and 18 deletions

View File

@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
const char *username="username";
const char *password="password";
const char *scppath="/tmp/TEST";
struct stat fileinfo;
libssh2_struct_stat fileinfo;
int rc;
off_t got=0;
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
}
/* Request a file via SCP */
channel = libssh2_scp_recv(session, scppath, &fileinfo);
channel = libssh2_scp_recv2(session, scppath, &fileinfo);
if (!channel) {
fprintf(stderr, "Unable to open a session: %d\n",
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
int amount=sizeof(mem);
if((fileinfo.st_size -got) < amount) {
amount = fileinfo.st_size -got;
amount = (int)(fileinfo.st_size -got);
}
rc = libssh2_channel_read(channel, mem, amount);