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

Re: possible issue with bsd_poll() on Windows


On Monday, 10 September 2018 21:48:39 CEST John Dunn wrote:
> 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?

Does the attach patch give you a useful error?


-- 
Andreas Schneider                 asn@xxxxxxxxxxxxxx
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
From fd5d0dbe9adb12cd71c605704154843d2531e45b Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@xxxxxxxxxxxxxx>
Date: Wed, 19 Sep 2018 12:39:54 +0200
Subject: [PATCH] session: Set error in ssh_handle_packets()

Signed-off-by: Andreas Schneider <asn@xxxxxxxxxxxxxx>
---
 src/session.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/session.c b/src/session.c
index d25c52cb..10aa58ed 100644
--- a/src/session.c
+++ b/src/session.c
@@ -23,6 +23,7 @@
 
 #include "config.h"
 
+#include <errno.h>
 #include <string.h>
 #include <stdlib.h>
 
@@ -628,6 +629,9 @@ int ssh_handle_packets(ssh_session session, int timeout) {
     }
     rc = ssh_poll_ctx_dopoll(ctx, tm);
     if (rc == SSH_ERROR) {
+        ssh_set_error(session,
+                      SSH_FATAL,
+                      "Failed to poll context: %s", strerror(errno));
         session->session_state = SSH_SESSION_STATE_ERROR;
     }
 
-- 
2.18.0


Follow-Ups:
RE: possible issue with bsd_poll() on WindowsJohn Dunn <John.Dunn@xxxxxxx>
References:
RE: possible issue with bsd_poll() on WindowsJohn Dunn <John.Dunn@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org