Subject: Re: [libssh2] #167: Unable to init SFTP session vs SSH-2.0-SSHD

Re: [libssh2] #167: Unable to init SFTP session vs SSH-2.0-SSHD

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Wed, 24 Mar 2010 22:28:47 -0000

#167: Unable to init SFTP session vs SSH-2.0-SSHD
--------------------+-------------------------------------------------------
 Reporter: ptjm | Owner: bagder
     Type: defect | Status: assigned
 Priority: normal | Milestone:
Component: SFTP | Version: 1.2.5
 Keywords: | Blocking:
Blockedby: |
--------------------+-------------------------------------------------------
Changes (by bagder):

  * owner: => bagder
  * status: new => assigned

Comment:

 I don't think it has anything to do with the openssl version.

 At line 460 in your log file, we can see how the error at code line
 src/sftp.c:629 is reached. The question is what 'rc' contains at that
 point!

 Also, as can be seen in that function there's a bad assumption that
 _libssh2_channel_write() will either return PACKET_EAGAIN, send the entire
 packet or fail. There's also the chance that it simply sent a piece of the
 packet and thus have to send the rest of the packet in a second try. I
 suspect that is what happening for you.

 Seeing the error code as I mention above, might help us verify this.

 If that is indeed the case (and really, even so if it isn't), then we
 should fix this function by keeping "number of bytes already sent" in a
 variable and allow the state machine to get back and send the rest of the
 packet at next oppurtunity.

-- 
Ticket URL: <http://libssh2.stuge.se/ticket/167#comment:1>
libssh2 <http://libssh2.stuge.se/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-24