On Apr 22, 2007, at 10:11 AM, Daniel Stenberg wrote:

> On Sun, 22 Apr 2007, James Housley wrote:
>
>> The new code in sftp.c gets the current blocking state of libssh2  
>> to restore it afterwards, then sets the state to what is desired.  
>> However, libssh2_sftp_read() will set the blocking state to 1, do  
>> it's business and then restore the state (probably to 0).  Since  
>> the blocking/non-blocking state is setup before it is passed to  
>> libssh2, libssh2 doesn't know what the current state is.
>>
>> We can require all new programs to explicitly call
>> libssh2_channel_set_blocking() to ensure libssh2 knows the proper
>> state of the socket.
>
> I propose that we instead remove libssh2_channel_set_blocking()  
> from the API, and always just provide the blocking and the non- 
> blocking ones. Then we know what mode to work on based on what  
> functions that are called.
>
> libssh2_channel_set_blocking() wasn't working before and it doesn't  
> make much sense to me now either.
>
> Or is there any benefit with still providing  
> libssh2_channel_set_blocking() ?

But in blocking mode, the current state of channel->blocking will be  
non-blocking, as currently written.  So when when existing programs  
are used after calling libssh2_sftp_read() the system will be set to  
non-blocking.

That and there is a long way/time to go until all the functions exist  
in both modes.  In the mean time, if the current blocking state of  
the socket were detected and channel->blocking was set by then,  
existing programs should continue to work with the new versions of  
the library.

Jim
--

/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
[EMAIL PROTECTED]      http://www.FreeBSD.org     The Power to Serve
[EMAIL PROTECTED]  http://www.TheHousleys.net
---------------------------------------------------------------------
"Eagles may soar, but weasels don't get sucked into jet engines"
     -- Anon



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to