T24: No way to get errno code from ssh_event_dopoll()

Description

Originally reported by migration: https://bugs.libssh.org/T24

If ssh_event_dopoll() fails with an SSH_ERROR, we would like to know what caused that failure at the socket level and handle certain errno codes specifically.

ssh_get_error_code() returns SSH_FATAL and doesn't help here.

Comments:

migration commented on 2017-06-19 06:44:56 UTC:

On Thursday, April 10th 2014 10:49:24, Stef Walter wrote:

The work around I'm using is screen-scraping for certain non-translated strings in ssh//get//error() message.


migration commented on 2017-06-19 06:44:56 UTC:

On Friday, April 11th 2014 00:07:08, Jon Simons wrote:

I've also written code as described here with the same movitation:

    rc = ssh//event//dopoll(event, timeout//msec);
    
    ....
    
    const char **lib//err//msg = ssh//get//error(session);
    
    ....
    
    if (rc == SSH//ERROR) {
        /** XXX no better way to extract failure reason **/
        #define DISCONN//MSG "Received SSH//MSG//DISCONNECT: 11"
        int graceful//disconnect = (strstr(lib//err//msg, DISCONN//MSG) != NULL);
    
    ...

An extended error getter would be useful.


migration commented on 2017-06-19 06:49:09 UTC:

On Thursday, April 10th 2014 10:49:24, Stef Walter wrote:

The work around I'm using is screen-scraping for certain non-translated strings in ssh//get//error() message.


migration commented on 2017-06-19 06:49:09 UTC:

On Friday, April 11th 2014 00:07:08, Jon Simons wrote:

I've also written code as described here with the same movitation:

    rc = ssh//event//dopoll(event, timeout//msec);
    
    ....
    
    const char **lib//err//msg = ssh//get//error(session);
    
    ....
    
    if (rc == SSH//ERROR) {
        /** XXX no better way to extract failure reason **/
        #define DISCONN//MSG "Received SSH//MSG//DISCONNECT: 11"
        int graceful//disconnect = (strstr(lib//err//msg, DISCONN//MSG) != NULL);
    
    ...

An extended error getter would be useful.


migration commented on 2017-06-19 06:50:52 UTC:

On Thursday, April 10th 2014 10:49:24, Stef Walter wrote:

The work around I'm using is screen-scraping for certain non-translated strings in ssh//get//error() message.


migration commented on 2017-06-19 06:50:52 UTC:

On Friday, April 11th 2014 00:07:08, Jon Simons wrote:

I've also written code as described here with the same movitation:

    rc = ssh//event//dopoll(event, timeout//msec);
    
    ....
    
    const char **lib//err//msg = ssh//get//error(session);
    
    ....
    
    if (rc == SSH//ERROR) {
        /** XXX no better way to extract failure reason **/
        #define DISCONN//MSG "Received SSH//MSG//DISCONNECT: 11"
        int graceful//disconnect = (strstr(lib//err//msg, DISCONN//MSG) != NULL);
    
    ...

An extended error getter would be useful.


migration commented on 2017-06-19 06:52:27 UTC:

On Thursday, April 10th 2014 10:49:24, Stef Walter wrote:

The work around I'm using is screen-scraping for certain non-translated strings in ssh//get//error() message.


migration commented on 2017-06-19 06:52:27 UTC:

On Friday, April 11th 2014 00:07:08, Jon Simons wrote:

I've also written code as described here with the same movitation:

    rc = ssh//event//dopoll(event, timeout//msec);
    
    ....
    
    const char **lib//err//msg = ssh//get//error(session);
    
    ....
    
    if (rc == SSH//ERROR) {
        /** XXX no better way to extract failure reason **/
        #define DISCONN//MSG "Received SSH//MSG//DISCONNECT: 11"
        int graceful//disconnect = (strstr(lib//err//msg, DISCONN//MSG) != NULL);
    
    ...

An extended error getter would be useful.


To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information