> -----Original Message-----
> From: libssh2-devel-boun...@cool.haxx.se 
> [mailto:libssh2-devel-boun...@cool.haxx.se] On Behalf Of 
> Daniel Stenberg
> Sent: Wednesday, September 16, 2009 10:31 PM
> To: libssh2 development
> Subject: RE: libss2 debug level
> 
> The -37 ones are just EAGAIN so they can mostly be ignored. 
> The first one after that is a "SFTP packet too large" which 
> in my ears sounds very interesting to research further...

Some new findings.

1. Here is the error output when I use my own account "qxu": 
======================================================
q...@durian(pts/4):~/opensrc/libssh2-1.2/example/simple[9]$ ./sftp 
13.198.98.190 qxu fair123 /home/qxu
...
libssh2_sftp_init()!
[libssh2] 0.765664 SFTP: Initializing SFTP subsystem
[libssh2] 0.765713 Failure Event: -37 - Would block
[libssh2] 0.765723 Failure Event: -37 - Would block starting up channel
[libssh2] 0.777871 Failure Event: -37 - Would block to request SFTP subsystem
[libssh2] 0.781220 SFTP: Sending FXP_INIT packet advertising version 3 support
[libssh2] 0.781270 SFTP: Requiring packet 2 id 0
[libssh2] 0.781280 SFTP: Asking for 2 packet
[libssh2] 0.781291 SFTP: recv packet
[libssh2] 0.815792 SFTP: Data begin - Packet Length: 1399157876
[libssh2] 0.815811 Failure Event: -25 - SFTP packet too large
[libssh2] 0.815817 Failure Event: -30 - Timeout waiting for response from SFTP 
subsystem
Unable to init SFTP session
all done
======================================================
To overcome this error (caused by a super-large packet length 1399157876), I 
have tried to change LIBSSH2_SFTP_PACKET_MAXLEN in include/libssh2_sftp.h to 
some bigger value, like 2,000,000,000. But that does't work (it hangs). So it 
seems the value can't be changed at will.

2. If I switched to another user "khng", the session is successful: 
======================================================
q...@durian(pts/4):~/opensrc/libssh2-1.2/example/simple[8]$ ./sftp 
13.198.98.190 khng seagate1 /home/khng
...
libssh2_sftp_init()!
[libssh2] 0.244597 SFTP: Initializing SFTP subsystem
...
[libssh2] 0.259909 SFTP: Sending FXP_INIT packet advertising version 3 support
[libssh2] 0.259979 SFTP: Requiring packet 2 id 0
[libssh2] 0.260000 SFTP: Asking for 2 packet
[libssh2] 0.260017 SFTP: recv packet
[libssh2] 0.296598 SFTP: Data begin - Packet Length: 5
[libssh2] 0.296630 SFTP: Received packet 2 (len 5)
[libssh2] 0.296644 SFTP: Asking for 2 packet
[libssh2] 0.296657 SFTP: Got 2
[libssh2] 0.296669 SFTP: Enabling SFTP version 3 compatability
libssh2_sftp_open()!
[libssh2] 0.296700 SFTP: Sending file open request
[libssh2] 0.296734 SFTP: Asking for 102 packet
[libssh2] 0.296748 SFTP: Asking for 101 packet
[libssh2] 0.296761 SFTP: recv packet
[libssh2] 0.336892 SFTP: Data begin - Packet Length: 13
[libssh2] 0.336915 SFTP: Received packet 102 (len 13)
[libssh2] 0.336933 SFTP: Asking for 102 packet
[libssh2] 0.336953 SFTP: Open command successful
libssh2_sftp_open() is done, now receive data!
libssh2_sftp_read()!
[libssh2] 0.337003 SFTP: Reading 1024 bytes from SFTP handle
[libssh2] 0.337050 SFTP: Asking for 103 packet
[libssh2] 0.337069 SFTP: Asking for 101 packet
[libssh2] 0.337085 SFTP: recv packet
[libssh2] 0.337215 SFTP: Data begin - Packet Length: 24
[libssh2] 0.337239 SFTP: Received packet 101 (len 24)
[libssh2] 0.337257 SFTP: Asking for 103 packet
[libssh2] 0.337273 SFTP: Asking for 101 packet
[libssh2] 0.337290 Failure Event: -31 - SFTP Protocol Error
[libssh2] 0.337312 SFTP: Closing handle
[libssh2] 0.337353 SFTP: Requiring packet 101 id 2
[libssh2] 0.337373 SFTP: Asking for 101 packet
[libssh2] 0.337389 SFTP: recv packet
[libssh2] 0.337519 SFTP: Data begin - Packet Length: 24
[libssh2] 0.337542 SFTP: Received packet 101 (len 24)
[libssh2] 0.337560 SFTP: Asking for 101 packet
[libssh2] 0.337577 SFTP: Got 101
all done
======================================================
The packet length for user "khng" is 5, 13, and 24, respectively. From this 
result, it seems the problem may be boiled down to the user account setup at 
the server's end. What is the possible setup that can lead to this problem?

By the way, "Failure Event: -31 - SFTP Protocol Error" appears in the session. 
Is it critical?

Thanks,
Xu Qiang
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to