-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use libssh2_scp_recv2 to support > 2GB files on windows over SFTP #451
Conversation
I would prefer to have a check for the libssh2 version in use and use some #ifdef logic to make the code still work as before with the older libssh2 and use the new function only when available! |
I updated my other comment, too but figured just in case I'd put it in both places: I was able to build and test tonight using the following setup: The only real special thing I did was to rename libssh2.lib to libssh2_a.lib so libcurl would be happy with linking it. It's a minor thing and, hey, I was warned about the creakiness of the curl build system. The builds went smoothly otherwise. Everything seems to be working as expected when I use the resulting binary, I can do something like 'curl -o c:\huge-frigging.file scp://user:pass@host/file/to/transfer' and it gets me the whole file. I tested a few 4g transfers and one 7.5g transfer from linux to the aforementioned windows system and the hashes matched. I see the unit tests failed, but If you'd like something more rigorous done by hand I'll try to squeeze it in. |
2fe3f38
to
076a696
Compare
@bagder, like this: dbyron0@076a696 ? |
@dbyron0 Exactly! |
Thanks a lot for your work on this. Landed the curl side of this fix now, so let's get the libssh2 release out soon and then we can soon celebrate the end of this long journey! |
Thank you. Glad it finally made it in :) |
@bagder @dbyron0 ,
As in my original issue (#329), any file greater than 2GB in size is still seen and downloaded as only 2047MB. |
I can't reproduce, although I did not try that exact version. I downloaded 4,414,115,840 Win10_1511_1_English_x64.iso via sftp and the hash matched.
update: tried scp as well, also fine |
I tried SFTP, and it is working correctly. That actually solves my use case! Thanks for the suggestion! Unfortunately, SCP is still bugged for me (seeing and transferring only 2047MB of >2GB files). Is there any configuration information I can give you to help track it down? |
I tried that build and I'm having the same problem. IIRC there's a compile-time define that turns on the support for large files via scp only if the libssh2 version is recent enough. The client does identify as SSH-2.0-libssh2_1.7.0 but is it possible the include is for an older version? I don't know what's up here. @vszakats |
I've made built-time trace tests, generated and verified Built-time trace patch: https://github.com/vszakats/harbour-deps/blob/7f3116ef7eded8aeabedec3583369de102216c36/curl.diff Not much idea what could cause large-file support to be broken with SSH/SCP. AFAICS there is no other public build for Windows, supporting that combination, to double-check it. |
If there is any useful patch or existing trace option that might help locating the problem, I'm ready to create further test builds with those included/enabled. |
According to a newly run test, large-file support is correctly enabled in libssh2 component, too: |
Thanks for checking Viktor. I still have no idea. When I have some free time I'll build for x64 to see if there's any difference. |
Moved to #858, please take any further correspondence there. |
Now that libssh2/libssh2#31 is merged to master of libssh2, here is the little bit left to use it in curl. I imagine we need to release a version of libssh2 that contains libssh2_scp_recv2 before it's safe to merge this, but I figured I'd get the ball rolling a bit.
Tested by receiving a > 2GB file on OS X 10.10.5 using a scp:// url. I could use a hand testing this on windows as I'm still struggling to build curl against a hand-built libssh2 there.
Also, these results from make check on OS X 10.10.5:
though note the same failures occurred on master.
I used this test config: