mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
use the CV2 db instance if the path prefix is cv2://
This commit is contained in:
parent
0b04f772ef
commit
1d2130610c
3 changed files with 9 additions and 7 deletions
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||||
|
|
||||||
#ifndef ZT_CONTROLLER_LIBPQ_HPP
|
#ifndef ZT_CONTROLLER_CV1_HPP
|
||||||
#define ZT_CONTROLLER_LIBPQ_HPP
|
#define ZT_CONTROLLER_CV1_HPP
|
||||||
|
|
||||||
#define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4
|
#define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4
|
||||||
|
|
||||||
|
@ -138,6 +138,6 @@ private:
|
||||||
|
|
||||||
} // namespace ZeroTier
|
} // namespace ZeroTier
|
||||||
|
|
||||||
#endif // ZT_CONTROLLER_LIBPQ_HPP
|
#endif // ZT_CONTROLLER_CV1_HPP
|
||||||
|
|
||||||
#endif // ZT_CONTROLLER_USE_LIBPQ
|
#endif // ZT_CONTROLLER_USE_LIBPQ
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||||
|
|
||||||
#ifndef ZT_CONTROLLER_LIBPQ_HPP
|
#ifndef ZT_CONTROLLER_CV2_HPP
|
||||||
#define ZT_CONTROLLER_LIBPQ_HPP
|
#define ZT_CONTROLLER_CV2_HPP
|
||||||
|
|
||||||
#define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4
|
#define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4
|
||||||
|
|
||||||
|
@ -108,5 +108,5 @@ private:
|
||||||
|
|
||||||
} // namespace Zerotier
|
} // namespace Zerotier
|
||||||
|
|
||||||
#endif // ZT_CONTROLLER_LIBPQ_HPP
|
#endif // ZT_CONTROLLER_CV2_HPP
|
||||||
#endif // ZT_CONTROLLER_USE_LIBPQ
|
#endif // ZT_CONTROLLER_USE_LIBPQ
|
|
@ -40,8 +40,8 @@
|
||||||
#include "LFDB.hpp"
|
#include "LFDB.hpp"
|
||||||
#include "FileDB.hpp"
|
#include "FileDB.hpp"
|
||||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||||
#include "PostgreSQL.hpp"
|
|
||||||
#include "CV1.hpp"
|
#include "CV1.hpp"
|
||||||
|
#include "CV2.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../node/Node.hpp"
|
#include "../node/Node.hpp"
|
||||||
|
@ -536,6 +536,8 @@ void EmbeddedNetworkController::init(const Identity &signingId,Sender *sender)
|
||||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||||
if ((_path.length() > 9)&&(_path.substr(0,9) == "postgres:")) {
|
if ((_path.length() > 9)&&(_path.substr(0,9) == "postgres:")) {
|
||||||
_db.addDB(std::shared_ptr<DB>(new CV1(_signingId,_path.substr(9).c_str(), _listenPort, _rc)));
|
_db.addDB(std::shared_ptr<DB>(new CV1(_signingId,_path.substr(9).c_str(), _listenPort, _rc)));
|
||||||
|
} else if ((_path.length() > 3)&&(_path.substr(0,3) == "cv2:")) {
|
||||||
|
_db.addDB(std::shared_ptr<DB>(new CV2(_signingId,_path.c_str(),_listenPort)));
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
_db.addDB(std::shared_ptr<DB>(new FileDB(_path.c_str())));
|
_db.addDB(std::shared_ptr<DB>(new FileDB(_path.c_str())));
|
||||||
|
|
Loading…
Add table
Reference in a new issue