Subject: Re: Cannot set up sftp connection?

Re: Cannot set up sftp connection?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 4 Jul 2009 22:33:35 +0200 (CEST)

On Sat, 4 Jul 2009, Steven Van Ingelgem wrote:

> 1) use the EAGAIN return value combined with the wait_socket as written in 1
> of the examples: result: block the stream. I imagine because the setting up
> of the event handler takes longer than the first event happening on the
> socket.

I doubt that's the real problem. When libssh2 is told to use blocking, it does
basically that exact procedure by itself under the hood. Everything internally
in libssh2 is done non-blocking.

> 2) do a while( == EAGAIN) loop without anything in there: result: +- 45s,
> meaning it is faster again. But it is hogging the CPU a lot.

Yeah, that's a senseless way to do it.

> Blocking mode doesn't work at all (Mac OS X) at my side... Even the example
> doesn't want to work :(.

Yes, you said that already so it's already a known problem.

However, due to what I said above about how blocking is implemented vs
non-blocking, it certainly feels like the bug should be not too hard to fix.
For someone who can repeat it. I can't.

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-07-04