Ticket #61 (closed defect)
libssh2_scp_recv fails on large files
|Reported by:||stevenayre||Owned by:|
I am trying to download a 2,719,984,337 byte (2.5 GB) file using scp_get in Net::SSH2, but it fails with the error "Invalid response from SCP server, invalid size" (LIBSSH2_ERROR_SCP_PROTOCOL).
Upon investigation, the problem lies in libssh2 490 of src/scp.c (in CVS):
session->scpRecv_size = strtol(p, &e, 10);
This returns a ERANGE error as 2,719,984,337 is more than the 2,147,483,647 limit of a signed integer.
Is there any way to get the library to support files larger than this limit? I'm guessing it'll be more involved than changing the data type to long long and using strtoll?