]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Remove invitation files when blacklisting or forgetting a node.
[meshlink] / src / meshlink.c
index 56da2a045452acf8004b0d0a04cbf1e7e2810ceb..3f191f9a6579547bf9c0c79a4573e84e5a2892da 100644 (file)
@@ -3430,6 +3430,9 @@ static bool blacklist(meshlink_handle_t *mesh, node_t *n) {
                mesh->node_status_cb(mesh, (meshlink_node_t *)n, false);
        }
 
+       /* Remove any outstanding invitations */
+       invitation_purge_node(mesh, n->name);
+
        return node_write_config(mesh, n) && config_sync(mesh, "current");
 }
 
@@ -3609,6 +3612,9 @@ bool meshlink_forget_node(meshlink_handle_t *mesh, meshlink_node_t *node) {
                return false;
        }
 
+       /* Delete any pending invitations */
+       invitation_purge_node(mesh, n->name);
+
        /* Delete the node struct and any remaining edges referencing this node */
        node_del(mesh, n);
 
@@ -3904,9 +3910,6 @@ static void channel_poll(struct utcp_connection *connection, size_t len) {
                }
 
                if(sent != (ssize_t)todo) {
-                       /* We should never get a partial send at this point */
-                       assert(sent <= 0);
-
                        /* Sending failed, abort all outstanding AIO buffers and send a poll callback. */
                        if(!aio_abort(mesh, channel, &channel->aio_send)) {
                                return;