From 5e3c6d9e0d89b8284cf60978b658dab12d2814d1 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 25 May 2015 14:21:05 -0700 Subject: Some nodeJS work, and apply fix from GitHub issue #166 plus a small optimization to avoid repeated calls to _allMulticastGroups(). --- node/Network.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index f99ea525..7976d901 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -106,7 +106,11 @@ public: /** * @return All multicast groups including learned groups that are behind any bridges we're attached to */ - std::vector allMulticastGroups() const; + inline std::vector allMulticastGroups() const + { + Mutex::Lock _l(_lock); + return _allMulticastGroups(); + } /** * @param mg Multicast group @@ -356,6 +360,7 @@ private: void _externalConfig(ZT1_VirtualNetworkConfig *ec) const; // assumes _lock is locked bool _isAllowed(const Address &peer) const; void _announceMulticastGroups(); + std::vector _allMulticastGroups() const; const RuntimeEnvironment *RR; uint64_t _id; -- cgit v1.2.3