Subject: Re: libssh2_sftp_init() blocks and does not return

Re: libssh2_sftp_init() blocks and does not return

From: Daniel Stenberg <>
Date: Fri, 20 Mar 2009 09:31:50 +0100 (CET)

On Thu, 19 Mar 2009, Daniel Stenberg wrote:

> In general it is painful to support both the way the code works now. I
> wonder if we can think of a better way...

Would it be completely crazy if we did all the internals of libssh2 to deal
with non-blocking only, and "only" provide wrapper code that deals with the
blockingness this way:

(pseudo code for how it'd work for blocking sockets)

  API-function ()
    do {
      rc = useinternal_function()
      if (rc) {
    } while (rc == EAGAIN);
    return rc;

The upside will be that only these upper layer functions would need to bother
about blockiness, and all the "core" functionality would always assume and use

We would also gain some control and be able to for example allow flexible
time-outs etc even for the blocking API.

Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
libssh2-devel mailing list
Received on 2009-03-20