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: Wed, 5 May 2010 15:47:51 +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.

Just found that during the bad transfer, curl has written twice to the remote server:
============================================================
[libssh2] 23.847629 SFTP: Asking for 102 packet
[libssh2] 23.847640 SFTP: Open command successful
[libssh2] 23.847687 SFTP: Writing 16384 bytes
[libssh2] 23.847730 Conn: Writing 16410 bytes on channel 0/0, stream #0
[libssh2] 23.847746 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11
[libssh2] 23.847755 Conn: Splitting write block due to 16311 byte window_size on
 0/0/0
[libssh2] 23.847785 Conn: Sending 16311 bytes on channel 0/0, stream_id=0
=> libssh2_transport_write plain (16320 bytes)
0000: 5E 00 00 00 00 00 00 3F B7 00 00 40 16 06 00 00 : ^......??.@....
0010: 00 02 00 00 00 01 30 00 00 00 00 00 00 00 00 00 : ......0.........
0020: 00 40 00 25 50 44 46 2D 31 2E 34 0A 25 F8 E5 D0 : .@.%PDF-1.4.%??
0030: C4 C6 0A 31 20 30 20 6F 62 6A 0A 3C 3C 20 2F 54 : ?.1 0 obj.<< /T
0040: 79 70 65 20 2F 43 61 74 61 6C 6F 67 0A 2F 50 61 : ype /Catalog./Pa
0050: 67 65 73 20 32 20 30 20 52 0A 3E 3E 0A 65 6E 64 : ges 2 0 R.>>.end
0060: 6F 62 6A 0A 0A 32 20 30 20 6F 62 6A 0A 3C 3C 20 : obj..2 0 obj.<<
0070: 2F 54 79 70 65 20 2F 50 61 67 65 73 0A 2F 4B 69 : /Type /Pages./Ki
0080: 64 73 20 5B 34 20 30 20 52 20 39 20 30 20 52 20 : ds [4 0 R 9 0 R
0090: 31 33 20 30 20 52 20 31 37 20 30 20 52 20 32 31 : 13 0 R 17 0 R 21
00a0: 20 30 20 52 20 32 35 20 30 20 52 20 32 39 20 30 : 0 R 25 0 R 29 0
00b0: 20 52 20 33 33 20 30 20 52 20 33 37 20 30 20 52 : R 33 0 R 37 0 R
00c0: 5D 0A 2F 43 6F 75 6E 74 20 39 0A 3E 3E 0A 65 6E : ]./Count 9.>>.en
00d0: 64 6F 62 6A 0A 0A 33 20 30 20 6F 62 6A 0A 3C 3C : dobj..3 0 obj.<<
00e0: 20 2F 50 72 6F 63 53 65 74 20 5B 2F 50 44 46 20 : /ProcSet [/PDF
00f0: 2F 54 65 78 74 20 2F 49 6D 61 67 65 42 20 2F 49 : /Text /ImageB /I
...
3f70: 89 55 A4 7F 94 6C B7 BE 2B F0 D1 4B A7 DE 22 90 : .U?.l?+?K?".
3f80: 19 8C 92 FA 98 38 15 A6 D1 12 D7 5E 2B B9 5D 30 : ...?8.?.?+?0
3f90: D9 53 69 57 AB B7 B3 8C 47 AB 77 D5 F3 CB 0F 3D : ?iW??G???=
3fa0: 3A A1 08 7B EA 58 1E A6 95 79 B1 B6 7A C2 0D 73 : :?{?.?y?z?s
3fb0: 7D E0 F9 00 36 33 34 CC DF 1F FD 34 10 CA 07 EA : }?.634?.?.??
3fc0: AB 4B 46 76 97 22 B7 83 D2 34 27 C6 1D 4B C3 47 : ?Fv."??'?K?
3fd0: 77 E8 83 B1 48 86 4F 61 04 66 AD FD 77 CD C5 8F : w??.Oa.f?w?.
3fe0: 05 E6 F5 09 : .?.
[libssh2] 23.874602 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11} [data not shown]
  3 511k 0 0 3 16311 0 699 0:12:28 0:00:23 0:12:05 712 3 511k 0 0 3 16311 0 670 0:13:01 0:00:24 0:12:37 682
[libssh2] 25.385055 Conn: Writing 99 bytes on channel 0/0, stream #0
[libssh2] 25.385072 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11
[libssh2] 25.385086 Conn: Writing 106 bytes on channel 0/0, stream #0
[libssh2] 25.385094 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11
...
[libssh2] 26.442157 Conn: Writing 15156 bytes on channel 0/0, stream #0
[libssh2] 26.442164 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11
[libssh2] 26.442174 Conn: Writing 15163 bytes on channel 0/0, stream #0
[libssh2] 26.597039 Socket: Recved 52/16384 bytes to 0x88a7de8+0
=> libssh2_transport_read() raw (52 bytes)
0000: 93 2D 0E 54 6D 38 34 76 E4 63 EB 17 BE EA C0 0E : .-.Tm84v????
0010: ED A2 D7 4F B4 B5 8E 50 7F 56 04 E8 CF F2 A2 EC : ???.P.V.???
0020: 05 32 07 E9 90 A9 E2 3B 0F 14 FB C6 11 96 B1 74 : .2.??;..?..?
0030: 64 AA 24 99 : d?.
=> libssh2_transport_read() plain (9 bytes)
0000: 5D 00 00 00 00 00 00 80 00 : ]........
[libssh2] 26.597093 Transport: Packet type 93 received, length=9
[libssh2] 26.597098 Conn: Window adjust received for channel 0/0, adding 32768 b
ytes, new window_size=32768
[libssh2] 26.597105 Socket: Error recving 16384 bytes to 0x88a7de8+0: 11
[libssh2] 26.597123 Conn: Sending 15163 bytes on channel 0/0, stream_id=0
=> libssh2_transport_write plain (15172 bytes)
0000: 5E 00 00 00 00 00 00 3B 3B 00 00 40 16 06 00 00 : ^......;;..@....
0010: 00 02 00 00 00 01 30 00 00 00 00 00 00 00 00 00 : ......0.........
0020: 00 40 00 25 50 44 46 2D 31 2E 34 0A 25 F8 E5 D0 : .@.%PDF-1.4.%??
0030: C4 C6 0A 31 20 30 20 6F 62 6A 0A 3C 3C 20 2F 54 : ?.1 0 obj.<< /T
0040: 79 70 65 20 2F 43 61 74 61 6C 6F 67 0A 2F 50 61 : ype /Catalog./Pa
0050: 67 65 73 20 32 20 30 20 52 0A 3E 3E 0A 65 6E 64 : ges 2 0 R.>>.end
0060: 6F 62 6A 0A 0A 32 20 30 20 6F 62 6A 0A 3C 3C 20 : obj..2 0 obj.<<
0070: 2F 54 79 70 65 20 2F 50 61 67 65 73 0A 2F 4B 69 : /Type /Pages./Ki
0080: 64 73 20 5B 34 20 30 20 52 20 39 20 30 20 52 20 : ds [4 0 R 9 0 R
0090: 31 33 20 30 20 52 20 31 37 20 30 20 52 20 32 31 : 13 0 R 17 0 R 21
00a0: 20 30 20 52 20 32 35 20 30 20 52 20 32 39 20 30 : 0 R 25 0 R 29 0
00b0: 20 52 20 33 33 20 30 20 52 20 33 37 20 30 20 52 : R 33 0 R 37 0 R
00c0: 5D 0A 2F 43 6F 75 6E 74 20 39 0A 3E 3E 0A 65 6E : ]./Count 9.>>.en
00d0: 64 6F 62 6A 0A 0A 33 20 30 20 6F 62 6A 0A 3C 3C : dobj..3 0 obj.<<
00e0: 20 2F 50 72 6F 63 53 65 74 20 5B 2F 50 44 46 20 : /ProcSet [/PDF
00f0: 2F 54 65 78 74 20 2F 49 6D 61 67 65 42 20 2F 49 : /Text /ImageB /I
...
============================================================
In what case, libcurl would write the same file to the remote server again?

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-05