What I am thinking right now is a non-blocking analogue to  
libssh2_sftp_packet_requirev() that calls a version of  
libssh2_sftp_packet_read() which keeps some internal storage up to the  
max SFTP packet size, and returns *EAGAIN until it snags a whole  
packet that can be validated.  Does this seem like the right approach?

Also, how would you feel about supporting larger read sizes than 32k?   
I took off the artificial cap for SFTP to test it out, but the packets  
are still maxing out at 64k (I haven't checked why yet).  I think  
supporting up to 100k or so would be nice, and the spec declares that  
the current max size only be supported, not that it must be the  
largest size supported.

On Feb 27, 2007, at 1:01 PM, Daniel Stenberg wrote:

> On Tue, 27 Feb 2007, Lucas Newman wrote:
>
>>> For the *readnb() case, we need to rip out usage of the  
>>> *requirev() functions and instead properly check for the packages  
>>> it wants and return (with an *EAGAIN return code) if they're not  
>>> present and make sure we use a state machine to deal with  
>>> incomplete reads until they are complete.
>>
>> Ah, I didn't know this was ongoing.  I can see libssh2_packet_read  
>> returning EAGAIN properly, so I guess we just have to propagate it  
>> up the chain?
>
> To be honest, I had forgot about this issue so it was good you  
> brought it up. But yes, the return code needs to be propagated, but  
> the sftp function also needs to be adapted to be able to get called  
> repeatedly until it has read a full sftp package to return.
>
>> I'll look into it.
>
> Great!


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to