]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
Don't call graph() twice when a new connection replaces an older one.
[meshlink] / src / protocol_auth.c
index 4026c41f54738e14623769513f61c9a25a032caa..a33c33979c84ba6b20776abb6e7f5f4743f049f7 100644 (file)
@@ -436,9 +436,11 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
                                n->connection->outgoing = NULL;
                        }
 
+                       /* Remove the edge before terminating the connection, to prevent a graph update. */
+                       edge_del(mesh, n->connection->edge);
+                       n->connection->edge = NULL;
+
                        terminate_connection(mesh, n->connection, false);
-                       /* Run graph algorithm to keep things in sync */
-                       graph(mesh);
                }
        }