diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-03-09 07:50:38 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-03-09 07:50:38 -0800 |
| commit | 0945d6ec0d7b94ba76b5f9490540d35212d21763 (patch) | |
| tree | 46b8937f430b51c6c7e24c8b871c9a4769d7267f /controller/RethinkDB.cpp | |
| parent | 77930607230eccdcb7011f6c70465bab3c32cc38 (diff) | |
| parent | 78d9cee4168ddccbdf6d6ea0eed05daa0dac92a4 (diff) | |
| download | infinitytier-0945d6ec0d7b94ba76b5f9490540d35212d21763.tar.gz infinitytier-0945d6ec0d7b94ba76b5f9490540d35212d21763.zip | |
Merge branch 'dev' into edge
Diffstat (limited to 'controller/RethinkDB.cpp')
| -rw-r--r-- | controller/RethinkDB.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/controller/RethinkDB.cpp b/controller/RethinkDB.cpp index a3bdfbc9..f6c8a59c 100644 --- a/controller/RethinkDB.cpp +++ b/controller/RethinkDB.cpp @@ -1,6 +1,6 @@ /* * ZeroTier One - Network Virtualization Everywhere - * Copyright (C) 2011-2015 ZeroTier, Inc. + * Copyright (C) 2011-2018 ZeroTier, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,10 +97,11 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Identity &myId,co try { json &ov = tmp["old_val"]; json &nv = tmp["new_val"]; - if (ov.is_object()||nv.is_object()) { - //if (nv.is_object()) printf("MEMBER: %s" ZT_EOL_S,nv.dump().c_str()); - this->_memberChanged(ov,nv,(this->_ready <= 0)); - } + json oldConfig,newConfig; + if (ov.is_object()) oldConfig = ov["config"]; + if (nv.is_object()) newConfig = nv["config"]; + if (oldConfig.is_object()||newConfig.is_object()) + this->_memberChanged(oldConfig,newConfig,(this->_ready <= 0)); } catch ( ... ) {} // ignore bad records } } @@ -138,10 +139,11 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Identity &myId,co try { json &ov = tmp["old_val"]; json &nv = tmp["new_val"]; - if (ov.is_object()||nv.is_object()) { - //if (nv.is_object()) printf("NETWORK: %s" ZT_EOL_S,nv.dump().c_str()); - this->_networkChanged(ov,nv,(this->_ready <= 0)); - } + json oldConfig,newConfig; + if (ov.is_object()) oldConfig = ov["config"]; + if (nv.is_object()) newConfig = nv["config"]; + if (oldConfig.is_object()||newConfig.is_object()) + this->_networkChanged(oldConfig,newConfig,(this->_ready <= 0)); } catch ( ... ) {} // ignore bad records } } |
