From: Guus Sliepen Date: Thu, 29 Oct 2020 22:38:22 +0000 (+0100) Subject: Also send the blacklist notification when we already have a connection. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=a5f139f0cef76bb2ef6d1bb888869cf17ca97f5d Also send the blacklist notification when we already have a connection. Instead of just closing the connection, and having to wait for the reconnection to happen to send the blacklist notification, we do it immediately when meshlink_blacklist() is called. --- diff --git a/src/meshlink.c b/src/meshlink.c index ee62078d..c34b24c9 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -3456,6 +3456,10 @@ static bool blacklist(meshlink_handle_t *mesh, node_t *n) { */ for list_each(connection_t, c, mesh->connections) { if(c->node == n) { + if(c->status.active) { + send_error(mesh, c, BLACKLISTED, "blacklisted"); + } + shutdown(c->socket, SHUT_RDWR); } }