cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Reflection for Secure IT Server

From: Xu, Qiang (FXSGSC) <Qiang.Xu_at_fujixerox.com>
Date: Tue, 4 May 2010 17:57:10 +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.

You mean libcurl is using non-blocking libssh2? That is interesing.

Just did a test with /libssh2-1.2.5/example/sftp_write_nonblock.c, and it is still doing fine:
===================================================
qxu_at_durian(pts/4):~/opensrc/libssh2-1.2.5/example[200]$ ./sftp_write_nonblock 13.121.8.133 <user> <pass> testSmall.pdf /Home/Scans/testSmall.pdf
Fingerprint: 7B 98 19 12 F3 A2 14 93 3F 72 85 3C 43 DA 19 EF 7F 9A 3A 6B
libssh2_sftp_init()!
libssh2_sftp_open()!
libssh2_sftp_open() is done, now send data!
all done
===================================================
The file in the destination has exactly the same size as the original local file does.

Here is the log extract with curl command-line test:
===================================================
qxu@durian(pts/1):~/opensrc/curl-7.20.1/src[309]$ ./curl -v -k -u <user>:<pass> -T testSmall.pdf sftp://13.121.8.133/Home/Scans/
* About to connect() to 13.121.8.133 port 22 (#0)
...
* Connected to 13.121.8.133 (13.121.8.133) port 22 (#0)
...
* SSH authentication methods available: password
...
* Initialized password authentication
* Authentication complete
...
0000: 5F 00 00 00 00 00 00 00 01 00 00 00 36 53 46 54 : _...........6SFT
0010: 50 20 73 65 72 76 65 72 20 74 65 72 6D 69 6E 61 : P server termina
0020: 74 65 64 20 62 79 20 65 78 63 65 70 74 69 6F 6E : ted by exception
0030: 3A 20 70 61 63 6B 65 74 20 74 6F 6F 20 6C 6F 6E : : packet too lon
0040: 67 0D 0A : g..
[libssh2] 10.725965 Transport: Packet type 95 received, length=67
[libssh2] 10.725971 Conn: 54 bytes packet_add() for 0/0/1
[libssh2] 10.725976 Conn: Ignoring extended data and refunding 54 bytes
[libssh2] 10.725980 Conn: Queueing 54 bytes for receive window adjustment for ch
annel 0/0
=> libssh2_transport_read() plain (25 bytes)
0000: 62 00 00 00 00 00 00 00 0B 65 78 69 74 2D 73 74 : b........exit-st
0010: 61 74 75 73 00 00 00 00 09 : atus.....
[libssh2] 10.726010 Transport: Packet type 98 received, length=25
[libssh2] 10.726015 Conn: Channel 0 received request type exit-status (wr 0)
[libssh2] 10.726020 Conn: Exit status 9 received for channel 0/0
...
* Closing connection #0
* Failed sending data to the peer

curl: (55) Failed sending data to the peer
===================================================
It looks the error msg is "server terminated by exception:: Packet too long", doesn't it? You can get the details from the attached zip file.

Thanks for your help,
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