From a5f139f0cef76bb2ef6d1bb888869cf17ca97f5d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 29 Oct 2020 23:38:22 +0100 Subject: [PATCH] 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. --- src/meshlink.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } } -- 2.39.5