diff common-channel.c @ 1800:c584b5602bd8

Return errstring on connect failure
author Matt Johnston <matt@ucc.asn.au>
date Fri, 05 Mar 2021 21:13:20 +0800
parents 79eef94ccea9
children 8a78cc13eb30
line wrap: on
line diff
--- a/common-channel.c	Thu Mar 04 23:57:12 2021 +0800
+++ b/common-channel.c	Fri Mar 05 21:13:20 2021 +0800
@@ -356,8 +356,7 @@
  * 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 @@
 	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))
 	}
 }