mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-09 08:46:54 +02:00
make sure the pg connstring is correct for cv2:// instances
This commit is contained in:
parent
1d2130610c
commit
fb7b07fc42
1 changed files with 8 additions and 1 deletions
|
@ -49,7 +49,14 @@ CV2::CV2(const Identity &myId, const char *path, int listenPort)
|
|||
{
|
||||
char myAddress[64];
|
||||
_myAddressStr = myId.address().toString(myAddress);
|
||||
_connString = std::string(path);
|
||||
|
||||
// replace cv2: with postgres: for the path/connstring
|
||||
std::string _path(path);
|
||||
if (_path.length() > 4 && _path.substr(0, 4) == "cv2:") {
|
||||
_path = "postgres:" + _path.substr(4);
|
||||
}
|
||||
_connString = std::string(_path);
|
||||
|
||||
auto f = std::make_shared<PostgresConnFactory>(_connString);
|
||||
_pool = std::make_shared<ConnectionPool<PostgresConnection> >(
|
||||
15, 5, std::static_pointer_cast<ConnectionFactory>(f));
|
||||
|
|
Loading…
Add table
Reference in a new issue