diff --git a/controller/CV1.hpp b/controller/CV1.hpp index dc7dc9fb2..f21eeb546 100644 --- a/controller/CV1.hpp +++ b/controller/CV1.hpp @@ -15,8 +15,8 @@ #ifdef ZT_CONTROLLER_USE_LIBPQ -#ifndef ZT_CONTROLLER_LIBPQ_HPP -#define ZT_CONTROLLER_LIBPQ_HPP +#ifndef ZT_CONTROLLER_CV1_HPP +#define ZT_CONTROLLER_CV1_HPP #define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4 @@ -138,6 +138,6 @@ private: } // namespace ZeroTier -#endif // ZT_CONTROLLER_LIBPQ_HPP +#endif // ZT_CONTROLLER_CV1_HPP #endif // ZT_CONTROLLER_USE_LIBPQ diff --git a/controller/CV2.hpp b/controller/CV2.hpp index 1d25fb50a..f62bbd310 100644 --- a/controller/CV2.hpp +++ b/controller/CV2.hpp @@ -15,8 +15,8 @@ #ifdef ZT_CONTROLLER_USE_LIBPQ -#ifndef ZT_CONTROLLER_LIBPQ_HPP -#define ZT_CONTROLLER_LIBPQ_HPP +#ifndef ZT_CONTROLLER_CV2_HPP +#define ZT_CONTROLLER_CV2_HPP #define ZT_CENTRAL_CONTROLLER_COMMIT_THREADS 4 @@ -108,5 +108,5 @@ private: } // namespace Zerotier -#endif // ZT_CONTROLLER_LIBPQ_HPP +#endif // ZT_CONTROLLER_CV2_HPP #endif // ZT_CONTROLLER_USE_LIBPQ \ No newline at end of file diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 65eaa1214..e9aa032bb 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -40,8 +40,8 @@ #include "LFDB.hpp" #include "FileDB.hpp" #ifdef ZT_CONTROLLER_USE_LIBPQ -#include "PostgreSQL.hpp" #include "CV1.hpp" +#include "CV2.hpp" #endif #include "../node/Node.hpp" @@ -536,6 +536,8 @@ void EmbeddedNetworkController::init(const Identity &signingId,Sender *sender) #ifdef ZT_CONTROLLER_USE_LIBPQ if ((_path.length() > 9)&&(_path.substr(0,9) == "postgres:")) { _db.addDB(std::shared_ptr(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(new CV2(_signingId,_path.c_str(),_listenPort))); } else { #endif _db.addDB(std::shared_ptr(new FileDB(_path.c_str())));