From e5f3a96476562c6ccc1b3bb757b266a1f2685947 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sun, 24 May 2015 16:32:52 +0300 Subject: [PATCH] RaftCore implementation fix --- .../dynamic_node_id_server/distributed/raft_core.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp index aaaa563381..a7abd0bcc4 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp @@ -247,6 +247,11 @@ private: setActiveMode(false); // Haha } + if (append_entries_client_.hasPendingCalls()) + { + append_entries_client_.cancelAllCalls(); // Refer to the response callback to learn why + } + if (active_mode_ || (next_server_index_ > 0)) { const NodeID node_id = cluster_.getRemoteServerNodeIDAtIndex(next_server_index_);