Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

ssh_fxp_name

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


zaq21wsx at rediffmail

Oct 29, 2009, 7:27 AM

Post #1 of 3 (743 views)
Permalink
ssh_fxp_name

Hello,

I have a very basic sftp client which is able to successfully intialize the transport layer, password authenticate, and start the sftp subsystem. Now, I am stuck with an issue when I try to retrieve the directory listing. Sometimes I get a transport packet in which the sftp packet length field registers a length greater than the enclosing transport packet. In othet words sometimes I get a transport packet whose lenght is less than what the sftp packet length field registers. This happens only sometimes. That is, if I give SSH_FXP_READDIR commands say 30 times on the same directory, then I get this packet after around 25-30 iterations. I tried to check the readability of the socket when this happens but the server does not send anything after this and select just hangs. I am not able to think of why this is happening and would apprecaite pointers in the right direction. thanks

Ajoy

good case packet header:

00 00 07 4c 0f 5e 00 00 00 00 00 00 07 33 00 00 07 2f 68 00 00 00 02 00 00 00 11 00 00 00 01 2e 00 00 00 ...

bad case packet header:

00 00 04 9c 07 5e 00 00 00 00 00 00 04 8b 00 00 07 2f 68 00 00 00 52 00 00 00 11 00 00 00 01 2e 00 00 00 ...
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


djm at mindrot

Oct 29, 2009, 5:11 PM

Post #2 of 3 (681 views)
Permalink
Re: ssh_fxp_name [In reply to]

On Fri, 29 Oct 2009, qqq wrote:

> Hello,
>
> I have a very basic sftp client which is able to successfully
> intialize the transport layer, password authenticate, and start the
> sftp subsystem. Now, I am stuck with an issue when I try to retrieve
> the directory listing. Sometimes I get a transport packet in which the
> sftp packet length field registers a length greater than the enclosing
> transport packet. In othet words sometimes I get a transport packet
> whose lenght is less than what the sftp packet length field registers.
> This happens only sometimes. That is, if I give SSH_FXP_READDIR
> commands say 30 times on the same directory, then I get this packet
> after around 25-30 iterations. I tried to check the readability of the
> socket when this happens but the server does not send anything after
> this and select just hangs. I am not able to think of why this is
> happening and would apprecaite pointers in the right direction. thanks

sftp operates at a protocol layer above the SSH transport, so the size of
sftp's packets may exceed the maximum allowed by the ssh connection. In
these cases, a sftp packet may span multiple transport packets.

-d

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


zaq21wsx at rediffmail

Nov 3, 2009, 3:25 AM

Post #3 of 3 (662 views)
Permalink
Re: Re: ssh_fxp_name [In reply to]

ok basically my FXP_READDIR loop consumed the entire channel window and the partial sftp packet was probably the last channel data server could send. Fixed that by introducing WINDOW_ADJUST message logic. Thanks for your inputs on this.

On Fri, 30 Oct 2009 05:38:29 +0530 wrote
>On Fri, 29 Oct 2009, qqq wrote:



> Hello,

>

> I have a very basic sftp client which is able to successfully

> intialize the transport layer, password authenticate, and start the

> sftp subsystem. Now, I am stuck with an issue when I try to retrieve

> the directory listing. Sometimes I get a transport packet in which the

> sftp packet length field registers a length greater than the enclosing

> transport packet. In othet words sometimes I get a transport packet

> whose lenght is less than what the sftp packet length field registers.

> This happens only sometimes. That is, if I give SSH_FXP_READDIR

> commands say 30 times on the same directory, then I get this packet

> after around 25-30 iterations. I tried to check the readability of the

> socket when this happens but the server does not send anything after

> this and select just hangs. I am not able to think of why this is

> happening and would apprecaite pointers in the right direction. thanks



sftp operates at a protocol layer above the SSH transport, so the size of

sftp's packets may exceed the maximum allowed by the ssh connection. In

these cases, a sftp packet may span multiple transport packets.



-d



_______________________________________________

openssh-unix-dev mailing list

openssh-unix-dev [at] mindrot

https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.