From 63160110240a7a8a4e6253cf910556cdb32ca9d6 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sun, 12 Oct 2014 11:42:49 -0700 Subject: Make crypto and compression build optimized in debug, and also try disabling peers.persist -- might ship this way as it seems more trouble than its worth. --- node/Peer.hpp | 5 ++++- node/Topology.cpp | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'node') diff --git a/node/Peer.hpp b/node/Peer.hpp index a24fb7b2..ead14311 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -50,7 +50,8 @@ #include "NonCopyable.hpp" #include "Mutex.hpp" -#define ZT_PEER_SERIALIZATION_VERSION 13 +// Comment out to disable peers.persist +//#define ZT_PEER_SERIALIZATION_VERSION 13 namespace ZeroTier { @@ -404,6 +405,7 @@ public: else return std::pair(); } +#ifdef ZT_PEER_SERIALIZATION_VERSION template inline void serialize(Buffer &b) const { @@ -456,6 +458,7 @@ public: return (p - startAt); } +#endif // ZT_PEER_SERIALIZATION_VERSION private: void _announceMulticastGroups(const RuntimeEnvironment *RR,uint64_t now); diff --git a/node/Topology.cpp b/node/Topology.cpp index 5f8401dd..10e5d9c7 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -290,6 +290,7 @@ bool Topology::authenticateRootTopology(const Dictionary &rt) void Topology::_dumpPeers() { +#ifdef ZT_PEER_SERIALIZATION_VERSION Buffer buf; std::string pdpath(RR->homePath + ZT_PATH_SEPARATOR_S + "peers.persist"); Mutex::Lock _l(_activePeers_m); @@ -335,14 +336,18 @@ void Topology::_dumpPeers() } fclose(pd); - Utils::lockDownFile(pdpath.c_str(),false); buf.burn(); + + Utils::lockDownFile(pdpath.c_str(),false); +#endif // ZT_PEER_SERIALIZATION_VERSION } void Topology::_loadPeers() { - Buffer buf; std::string pdpath(RR->homePath + ZT_PATH_SEPARATOR_S + "peers.persist"); + +#ifdef ZT_PEER_SERIALIZATION_VERSION + Buffer buf; Mutex::Lock _l(_activePeers_m); _activePeers.clear(); @@ -374,8 +379,10 @@ void Topology::_loadPeers() } fclose(pd); - Utils::rm(pdpath); buf.burn(); +#endif // ZT_PEER_SERIALIZATION_VERSION + + Utils::rm(pdpath); } } // namespace ZeroTier -- cgit v1.2.3