From f80ec871f6f4c63a28b9b8192477114b7aac696d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 27 Jan 2014 23:13:36 -0800 Subject: Make EthernetTap creation occur in a background thread in Network since it's a time consuming operation on Windows. This fixes one of the last remaining Windows problems. --- node/NodeConfig.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'node/NodeConfig.cpp') diff --git a/node/NodeConfig.cpp b/node/NodeConfig.cpp index eb0802a4..acdcd49d 100644 --- a/node/NodeConfig.cpp +++ b/node/NodeConfig.cpp @@ -115,14 +115,6 @@ NodeConfig::~NodeConfig() { } -void NodeConfig::whackAllTaps() -{ - std::vector< SharedPtr > nwlist; - Mutex::Lock _l(_networks_m); - for(std::map< uint64_t,SharedPtr >::const_iterator n(_networks.begin());n!=_networks.end();++n) - n->second->tap().whack(); -} - void NodeConfig::clean() { Mutex::Lock _l(_networks_m); @@ -205,7 +197,7 @@ std::vector NodeConfig::execute(const char *command) _P("200 listnetworks "); for(std::map< uint64_t,SharedPtr >::const_iterator nw(_networks.begin());nw!=_networks.end();++nw) { std::string tmp; - std::set ips(nw->second->tap().ips()); + std::set ips(nw->second->ips()); for(std::set::iterator i(ips.begin());i!=ips.end();++i) { if (tmp.length()) tmp.push_back(','); @@ -219,13 +211,14 @@ std::vector NodeConfig::execute(const char *command) age = 0; age /= 1000; + std::string dn(nw->second->tapDeviceName()); _P("200 listnetworks %.16llx %s %s %lld %s %s %s", (unsigned long long)nw->first, ((nconf) ? nconf->name().c_str() : "?"), Network::statusString(nw->second->status()), age, ((nconf) ? (nconf->isOpen() ? "public" : "private") : "?"), - nw->second->tap().deviceName().c_str(), + (dn.length() > 0) ? dn.c_str() : "?", ((tmp.length() > 0) ? tmp.c_str() : "-")); } } else if (cmd[0] == "join") { -- cgit v1.2.3