session CHANGE call home messages enhanced
diff --git a/src/session_client.c b/src/session_client.c
index f01a57e..bd023bd 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -471,9 +471,7 @@
break;
}
- if (sock == -1) {
- ERR("Unable to connect to %s:%s (%s).", host, port_s, strerror(errno));
- } else {
+ if (sock != -1) {
VRB("Successfully connected to %s:%s over %s.", host, port_s, (res->ai_family == AF_INET6) ? "IPv6" : "IPv4");
}
freeaddrinfo(res_list);
diff --git a/src/session_client_ssh.c b/src/session_client_ssh.c
index 5410591..b2f91c5 100644
--- a/src/session_client_ssh.c
+++ b/src/session_client_ssh.c
@@ -1317,6 +1317,7 @@
/* create and connect socket */
sock = nc_sock_connect(host, port);
if (sock == -1) {
+ ERR("Unable to connect to %s:%u (%s).", host, port, strerror(errno));
goto fail;
}
ssh_options_set(session->ti.libssh.session, SSH_OPTIONS_FD, &sock);
@@ -1486,6 +1487,7 @@
/* create and assign communication socket */
sock = nc_sock_connect(host, port);
if (sock == -1) {
+ ERR("Unable to connect to %s:%u (%s).", host, port, strerror(errno));
goto fail;
}
ssh_options_set(session->ti.libssh.session, SSH_OPTIONS_FD, &sock);
diff --git a/src/session_client_tls.c b/src/session_client_tls.c
index 649614b..e54b292 100644
--- a/src/session_client_tls.c
+++ b/src/session_client_tls.c
@@ -512,6 +512,7 @@
/* create and assign socket */
sock = nc_sock_connect(host, port);
if (sock == -1) {
+ ERR("Unable to connect to %s:%u (%s).", host, port, strerror(errno));
goto fail;
}
SSL_set_fd(session->ti.tls, sock);
diff --git a/src/session_server.c b/src/session_server.c
index 31bf4f0..ce2719e 100755
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -2620,6 +2620,7 @@
cur_endpt = &client->ch_endpts[0];
cur_endpt_name = strdup(cur_endpt->name);
+ VRB("Call Home client \"%s\" connecting...", data->client_name);
while (1) {
msgtype = nc_connect_ch_client_endpt(client, cur_endpt, &session);
@@ -2627,9 +2628,11 @@
/* UNLOCK */
nc_server_ch_client_unlock(client);
+ VRB("Call Home client \"%s\" session %u established.", data->client_name, session->id);
if (nc_server_ch_client_thread_session_cond_wait(session, data)) {
goto cleanup;
}
+ VRB("Call Home client \"%s\" session terminated, reconnecting...", client->name);
/* LOCK */
client = nc_server_ch_client_with_endpt_lock(data->client_name);