From 05c1074d1b37266883449c328fcdced5a49a7933 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 22 Dec 2016 14:37:50 +1100 Subject: [PATCH] Add console message when remote trusted server disconnects, displaying IP for disconnected passthroughs as well as id. --- src/connector.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/connector.c b/src/connector.c index 281a4a87..ff9badb7 100644 --- a/src/connector.c +++ b/src/connector.c @@ -356,17 +356,24 @@ out: /* Client must hold a reference count */ static int drop_client(cdata_t *cdata, client_instance_t *client) { - bool passthrough = client->passthrough; + bool passthrough = client->passthrough, remote = client->remote; + char address_name[INET6_ADDRSTRLEN]; int64_t client_id = client->id; int fd = -1; + strcpy(address_name, client->address_name); ck_wlock(&cdata->lock); fd = __drop_client(cdata, client); ck_wunlock(&cdata->lock); if (fd > -1) { - if (passthrough) - LOGNOTICE("Connector dropped passthrough %"PRId64, client_id); + if (passthrough) { + LOGNOTICE("Connector dropped passthrough %"PRId64" %s", + client_id, address_name); + } else if (remote) { + LOGWARNING("Remote trusted server client %"PRId64" %s disconnected", + client_id, address_name); + } LOGDEBUG("Connector dropped fd %d", fd); }