Subject: Re: [libssh2] meaning of -37 "Failed getting banner" / "Unable to exchange encryption keys" /

Re: [libssh2] meaning of -37 "Failed getting banner" / "Unable to exchange encryption keys" /

From: Nick Rudnick <nick.rudnick_at_googlemail.com>
Date: Thu, 26 Apr 2012 21:53:33 +0200

Hi TJ,

strangely, there isn't, but instead a return code of -1 means poll()
throwing an error – namely "Interrupted system call" (errno=4).

*poll*() returns the number of descriptors that are ready for I/O, or
-1 if an error occurred. If the time limit expires, *poll*() returns
0. If *poll*() returns with an error, including one due to an
interrupted call, the fds array will be unmodified.
(http://www.daemon-systems.org/man/poll.2.html)

Seemingly, this has something to do with a property of

session->socket_fd

Thanks for your interest, Nick

2012/4/26 TJ Saunders <tj_at_castaglia.org>

>
> > With your method, the error message is 'Resource temporarily unavailable'
> > (!)
> >
> > Digging deeper, I found two remarkable things:
> >
> > 1) session->api_timeout == 0
> > ... might be due to the interface (no session->api_timeout set??), but
> this
> > doesn't seem to lead to program interruption.
> >
> > 2) in session.c::_libssh2_wait_socket(), line 632 – HAVE_POLL holds...
> >
> > rc = poll(sockets, 1, has_timeout?ms_to_next: -1);
> >
> > returns -1, which directly leads to LIBSSH2_ERROR_TIMEOUT.
> >
> > Any idea??
>
> From that "Main: TIMEOUT" message you reported, it sounds like your
> application (which is using libssh2) has some sort of overall
> timeout/timer set. Is it possible that that timer is being exceeded
> unexpectedly, or set too short?
>
> TJ
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Mankind will not be reasoned out of the feelings of humanity.
>
> -Sir William Blackstone
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-04-26