diff --git a/src/jamidht/conversation.cpp b/src/jamidht/conversation.cpp index 085da87bc14132de685307612e356412abe1379e..b3f5e5db19af1b682a3a82ec0e7d6c00cb7a3ed8 100644 --- a/src/jamidht/conversation.cpp +++ b/src/jamidht/conversation.cpp @@ -860,8 +860,9 @@ Conversation::removeGitSocket(const DeviceId& deviceId) } void -Conversation::removeGitSockets() +Conversation::shutdownConnections() { + pimpl_->fallbackTimer_->cancel(); pimpl_->gitSocketList_.clear(); pimpl_->swarmManager_->shutdown(); pimpl_->checkedMembers_.clear(); diff --git a/src/jamidht/conversation.h b/src/jamidht/conversation.h index 227afeb9dced17eb21e64e6b0cb835cdb1dcdf9b..5b468745e8fc27a4dddbaece89d5b6baff6f6f19 100644 --- a/src/jamidht/conversation.h +++ b/src/jamidht/conversation.h @@ -510,7 +510,11 @@ public: std::shared_ptr<ChannelSocket> gitSocket(const DeviceId& deviceId) const; void addGitSocket(const DeviceId& deviceId, const std::shared_ptr<ChannelSocket>& socket); void removeGitSocket(const DeviceId& deviceId); - void removeGitSockets(); + + /** + * Stop SwarmManager, bootstrap and gitSockets + */ + void shutdownConnections(); /** * Used to avoid multiple connections, we just check if we got a swarm channel with a specific * device diff --git a/src/jamidht/conversation_module.cpp b/src/jamidht/conversation_module.cpp index 097e8267b03762fadc6e91ab04557d105827817a..d779c41c6f8c4d4452d02625c21c0f14f1ea581a 100644 --- a/src/jamidht/conversation_module.cpp +++ b/src/jamidht/conversation_module.cpp @@ -2712,7 +2712,7 @@ ConversationModule::shutdownConnections() { std::lock_guard<std::mutex> lk(pimpl_->conversationsMtx_); for (auto& [k, conversation] : pimpl_->conversations_) - conversation->removeGitSockets(); + conversation->shutdownConnections(); } { std::lock_guard<std::mutex> lk(pimpl_->pendingConversationsFetchMtx_);