diff options
author | Matt Johnston <matt@ucc.asn.au> | 2021-03-05 21:13:20 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2021-03-05 21:13:20 +0800 |
commit | 3c2f113a783651aae7612dcffdc8e74a9db69702 (patch) | |
tree | 47b4f214d863ba7c56e1c7803ec10d5b8d5964ce | |
parent | f193e95a3ecd9e1c9ecf4b594517f3326e40f5e5 (diff) |
Return errstring on connect failure
-rw-r--r-- | channel.h | 2 | ||||
-rw-r--r-- | common-channel.c | 7 |
2 files changed, 4 insertions, 5 deletions
@@ -104,7 +104,7 @@ struct ChanType { void (*cleanup)(const struct Channel*); }; -/* Callback for connect_remote */ +/* Callback for connect_remote. errstring may be NULL if result == DROPBEAR_SUCCESS */ void channel_connect_done(int result, int sock, void* user_data, const char* errstring); void chaninitialise(const struct ChanType *chantypes[]); diff --git a/common-channel.c b/common-channel.c index 73652ab..52def47 100644 --- a/common-channel.c +++ b/common-channel.c @@ -356,8 +356,7 @@ static void check_close(struct Channel *channel) { * if so, set up the channel properly. Otherwise, the channel is cleaned up, so * it is important that the channel reference isn't used after a call to this * function */ -void channel_connect_done(int result, int sock, void* user_data, const char* UNUSED(errstring)) { - +void channel_connect_done(int result, int sock, void* user_data, const char* errstring) { struct Channel *channel = user_data; TRACE(("enter channel_connect_done")) @@ -373,9 +372,9 @@ void channel_connect_done(int result, int sock, void* user_data, const char* UNU else { send_msg_channel_open_failure(channel->remotechan, - SSH_OPEN_CONNECT_FAILED, "", ""); + SSH_OPEN_CONNECT_FAILED, errstring, ""); remove_channel(channel); - TRACE(("leave check_in_progress: fail")) + TRACE(("leave check_in_progress: fail. internal errstring: %s", errstring)) } } |