[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: possible issue with bsd_poll() on Windows


I'm working on submitting a patch to fix this behavior in 0.8.2 and am still hoping to get some guidance on how best to propagate the error up from inside the bsd_poll() function up so the ssh_get_error can actual return a useful error message. Any ideas?

-----Original Message-----
From: John Dunn <John.Dunn@xxxxxxx> 
Sent: Friday, July 6, 2018 10:25 AM
To: libssh@xxxxxxxxxx
Subject: RE: possible issue with bsd_poll() on Windows

On Friday, July 6, 2018 12:22 AM Andreas Schneider wrote:

> So I think this is what you need to do, setting the right errno (ECONNREFUSED) for WSAECONNREFUSED and return -1.

I don't think it's that simple. Given the code at the end of the bsd_poll loop that increments rc if any bits beyond POLLHUP are set I think I need to make sure that only POLLHUP is set in .revents.

If I do end up returning -1 from bsd_poll things do error out correctly but I don't see any evidence that errno is ever looked at to generate an error message. As far as I can tell SSH_ERROR is just bubbled up and directly returned from ssh_connect and then my call to ssh_get_error returns an empty string. Is there a call I need to make to stuff something into the error_struct contained within the ssh_session?


Follow-Ups:
Re: possible issue with bsd_poll() on WindowsAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: possible issue with bsd_poll() on WindowsAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org