Page MenuHomePhabricator

No way to get errno code from ssh_event_dopoll()
Open, NormalPublic

Description

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.

Event Timeline

migration created this object with visibility "Restricted Project (Project)".
migration created this object with edit policy "Restricted Project (Project)".

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 sshgeterror() message.

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.

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 sshgeterror() message.

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.

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 sshgeterror() message.

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.

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 sshgeterror() message.

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.

asn updated the task description. (Show Details)Sep 4 2018, 9:08 PM
asn changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".