]> git.meshlink.io Git - meshlink/blobdiff - src/graph.c
Inform UTCP when a node is offline, so it will start connection timeouts.
[meshlink] / src / graph.c
index a6e38e42ea914bda3cb913b902b84ca7a72b1388..8e39b98d62f7e0c0167ad36b4fa697c2e7864cd2 100644 (file)
@@ -229,16 +229,21 @@ static void check_reachability(meshlink_handle_t *mesh) {
 
                        timeout_del(&mesh->loop, &n->mtutimeout);
 
-                       update_node_status(mesh, n);
+                       if(!n->status.blacklisted) {
+                               update_node_status(mesh, n);
+                       }
 
                        if(!n->status.reachable) {
                                update_node_udp(mesh, n, NULL);
-                               memset(&n->status, 0, sizeof(n)->status);
+                               n->status.broadcast = false;
                                n->options = 0;
+                               utcp_offline(n->utcp, true);
                        } else if(n->connection) {
                                if(n->connection->outgoing) {
                                        send_req_key(mesh, n);
                                }
+
+                               utcp_offline(n->utcp, false);
                        }
                }
        }