mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-05 20:41:44 -07:00
clang-format
This commit is contained in:
parent
d45f280cb7
commit
ba2a4a605c
140 changed files with 19214 additions and 17403 deletions
|
@ -8,48 +8,48 @@ using namespace nlohmann;
|
|||
|
||||
using namespace ZeroTier;
|
||||
|
||||
MemberNotificationReceiver::MemberNotificationReceiver(DB *p, pqxx::connection &c, const std::string &channel)
|
||||
: pqxx::notification_receiver(c, channel)
|
||||
, _psql(p)
|
||||
MemberNotificationReceiver::MemberNotificationReceiver(DB* p, pqxx::connection& c, const std::string& channel) : pqxx::notification_receiver(c, channel), _psql(p)
|
||||
{
|
||||
fprintf(stderr, "initialize MemberNotificationReceiver\n");
|
||||
}
|
||||
|
||||
|
||||
void MemberNotificationReceiver::operator() (const std::string &payload, int packend_pid) {
|
||||
void MemberNotificationReceiver::operator()(const std::string& payload, int packend_pid)
|
||||
{
|
||||
fprintf(stderr, "Member Notification received: %s\n", payload.c_str());
|
||||
Metrics::pgsql_mem_notification++;
|
||||
json tmp(json::parse(payload));
|
||||
json &ov = tmp["old_val"];
|
||||
json &nv = tmp["new_val"];
|
||||
json& ov = tmp["old_val"];
|
||||
json& nv = tmp["new_val"];
|
||||
json oldConfig, newConfig;
|
||||
if (ov.is_object()) oldConfig = ov;
|
||||
if (nv.is_object()) newConfig = nv;
|
||||
if (ov.is_object())
|
||||
oldConfig = ov;
|
||||
if (nv.is_object())
|
||||
newConfig = nv;
|
||||
if (oldConfig.is_object() || newConfig.is_object()) {
|
||||
_psql->_memberChanged(oldConfig,newConfig,_psql->isReady());
|
||||
_psql->_memberChanged(oldConfig, newConfig, _psql->isReady());
|
||||
fprintf(stderr, "payload sent\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NetworkNotificationReceiver::NetworkNotificationReceiver(DB *p, pqxx::connection &c, const std::string &channel)
|
||||
: pqxx::notification_receiver(c, channel)
|
||||
, _psql(p)
|
||||
NetworkNotificationReceiver::NetworkNotificationReceiver(DB* p, pqxx::connection& c, const std::string& channel) : pqxx::notification_receiver(c, channel), _psql(p)
|
||||
{
|
||||
fprintf(stderr, "initialize NetworkNotificationReceiver\n");
|
||||
}
|
||||
|
||||
void NetworkNotificationReceiver::operator() (const std::string &payload, int packend_pid) {
|
||||
void NetworkNotificationReceiver::operator()(const std::string& payload, int packend_pid)
|
||||
{
|
||||
fprintf(stderr, "Network Notification received: %s\n", payload.c_str());
|
||||
Metrics::pgsql_net_notification++;
|
||||
json tmp(json::parse(payload));
|
||||
json &ov = tmp["old_val"];
|
||||
json &nv = tmp["new_val"];
|
||||
json& ov = tmp["old_val"];
|
||||
json& nv = tmp["new_val"];
|
||||
json oldConfig, newConfig;
|
||||
if (ov.is_object()) oldConfig = ov;
|
||||
if (nv.is_object()) newConfig = nv;
|
||||
if (ov.is_object())
|
||||
oldConfig = ov;
|
||||
if (nv.is_object())
|
||||
newConfig = nv;
|
||||
if (oldConfig.is_object() || newConfig.is_object()) {
|
||||
_psql->_networkChanged(oldConfig,newConfig,_psql->isReady());
|
||||
_psql->_networkChanged(oldConfig, newConfig, _psql->isReady());
|
||||
fprintf(stderr, "payload sent\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue