From c91852f897d74034f1810c142f00baabe9d60c1c Mon Sep 17 00:00:00 2001 From: "Artyom V. Poptsov" Date: Tue, 23 May 2017 20:43:22 +0300 Subject: channel-func.c (guile_ssh_channel_open_forward): Log warnings * libguile-ssh/channel-func.c (guile_ssh_channel_open_forward): Log a warning if a forwarding channel could not be open. * tests/tunnel.scm ("port forwarding, direct, disconnected session"): New test case. --- libguile-ssh/channel-func.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libguile-ssh') diff --git a/libguile-ssh/channel-func.c b/libguile-ssh/channel-func.c index 4e2980f..ea5715b 100644 --- a/libguile-ssh/channel-func.c +++ b/libguile-ssh/channel-func.c @@ -275,8 +275,15 @@ SCM_GSSH_DEFINE (guile_ssh_channel_open_forward, c_remote_host, scm_to_int32 (remote_port), c_source_host, scm_to_int32 (local_port)); - if (res == SSH_OK) + if (res == SSH_OK) { SCM_SET_CELL_TYPE (channel, SCM_CELL_TYPE (channel) | SCM_OPN); + } else { + _gssh_log_warning (FUNC_NAME, + "Could not open forwarding channel", + scm_list_n (channel, remote_host, + remote_port, source_host, + local_port, SCM_UNDEFINED)); + } scm_dynwind_end (); -- cgit v1.2.3