Subject: Re: [libssh2] Non-blocking vs. default mode

Re: [libssh2] Non-blocking vs. default mode

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 22 Apr 2007 16:11:24 +0200 (CEST)

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() ?

-------------------------------------------------------------------------
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_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-04-22