curl-library
RE: Reflection for Secure IT Server
Date: Tue, 4 May 2010 20:16:28 +0800
> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se
> [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of
> Daniel Stenberg
> Sent: Tuesday, May 04, 2010 5:04 PM
> To: libcurl development
> Subject: RE: Reflection for Secure IT Server
>
> Yes, but the sftp_write.c example is using blocking mode so
> it isn't directly comparable to what libcurl does. When doing
> things non-blocking of course there needs to be some socket
> operations involved.
Daniel:
The test with the libssh2 example utility sftp_write_nonblock (./sftp_write_nonblock 13.121.8.133 <user> <pass> testSmall.pdf /Home/Scans/testSmall.pdf) succeeds, while curl command ( ./curl -v -k -u <user>:<pass> -T testSmall.pdf sftp://13.121.8.133/Home/Scans/) fails.
As you said, curl is using non-blocking way of sftp transfer (libssh2_session_set_blocking(sshc->ssh_session, 0)), just as sftp_write_nonblock does (libssh2_session_set_blocking(session, 0)). But there must be some difference between them, right? Otherwise, they should behave the same way against the same sftp server.
I am having difficulty in tracing sftp function flow in libcurl. For example, libssh2_sftp_write() is called in Curl_sftp_send(), which is called by Curl_write() in "sendf.c", and by readwrite_upload() in "transfer.c". For me, it is not as clear as in "sftp_write_nonblock.c".
Since you are the developer and more familiar with the code, could you tell me what is the major difference between libcurl sftp code and the code in "sftp_write_nonblock.c"?
Thanks,
Xu Qiang
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-04