From c1cac45a5438e068f3349b70064a5b2450f1b611 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Tue, 22 Aug 2023 20:32:36 -0400
Subject: [PATCH] dnc: cleanup

Change-Id: Ia525d076480015580c73e181ce214f8c387b4ffd
---
 tools/common.cpp   | 4 +---
 tools/dnc/dnc.cpp  | 2 +-
 tools/dnc/dnc.h    | 2 --
 tools/dnc/main.cpp | 1 +
 4 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/common.cpp b/tools/common.cpp
index 101fbb9..35f971c 100644
--- a/tools/common.cpp
+++ b/tools/common.cpp
@@ -15,12 +15,12 @@
  *  along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 #include "certstore.h"
-#include <opendht/crypto.h>
 #include "connectionmanager.h"
 #include "common.h"
 #include "fileutils.h"
 #include "ice_transport.h"
 
+#include <opendht/crypto.h>
 #include <iostream>
 #include <string>
 #include <filesystem>
@@ -30,8 +30,6 @@
 
 namespace dhtnet {
 
-std::shared_ptr<asio::posix::stream_descriptor> stdinDescriptor;
-
 dht::crypto::Identity
 loadIdentity(bool isServer)
 {
diff --git a/tools/dnc/dnc.cpp b/tools/dnc/dnc.cpp
index dddc7b1..9430cfc 100644
--- a/tools/dnc/dnc.cpp
+++ b/tools/dnc/dnc.cpp
@@ -75,7 +75,7 @@ Dnc::Dnc(dht::crypto::Identity identity,
 
     auto config = connectionManagerConfig(identity, bootstrap_ip_add, bootstrap_port, logger, certStore, ioContext, iceFactory);
     // create a connection manager
-    connectionManager = std::make_unique<ConnectionManager>(move(config));
+    connectionManager = std::make_unique<ConnectionManager>(std::move(config));
 
     connectionManager->onDhtConnected(identity.first->getPublicKey());
     connectionManager->onICERequest([this](const dht::Hash<32>&) { // handle ICE request
diff --git a/tools/dnc/dnc.h b/tools/dnc/dnc.h
index 0c8c7c1..c3333df 100644
--- a/tools/dnc/dnc.h
+++ b/tools/dnc/dnc.h
@@ -53,8 +53,6 @@ private:
     std::shared_ptr<asio::io_context> ioContext;
     std::thread ioContextRunner;
 
-    std::shared_ptr<asio::posix::stream_descriptor> stdinDescriptor;
-
     std::pair<std::string, std::string> parseName(const std::string_view name);
 };
 
diff --git a/tools/dnc/main.cpp b/tools/dnc/main.cpp
index e0eeeeb..5d550b0 100644
--- a/tools/dnc/main.cpp
+++ b/tools/dnc/main.cpp
@@ -16,6 +16,7 @@
  */
 #include "dnc.h"
 #include "common.h"
+
 #include <string>
 #include <vector>
 #include <iostream>
-- 
GitLab