Loading client/client.cpp +10 −0 Changes for client/client.cpp: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1267,7 +1267,15 @@ ConnectionPool::ConnectionPool(const std::string& url, ConnectionPool::~ConnectionPool() = default; void ConnectionPool::setTlsVerify(bool verify) { std::lock_guard<std::mutex> lk(_Mutex); _TlsVerify = verify; for (auto& entry : _Idle) entry.con->setTlsVerify(verify); } PooledConnection ConnectionPool::acquire() { bool tls_verify = true; { std::lock_guard<std::mutex> lk(_Mutex); if (!_Idle.empty()) { Loading @@ -1275,12 +1283,14 @@ PooledConnection ConnectionPool::acquire() { _Idle.pop_front(); return PooledConnection(this, std::move(entry.con), std::move(entry.clt)); } tls_verify = _TlsVerify; } // Create new connection auto con = std::make_unique<ClientConnection>(); con->setUrl(_Url); con->setClientName(_CltName); con->setClientSecret(_CltSecret); con->setTlsVerify(tls_verify); auto clt = std::make_unique<Client>(*con); return PooledConnection(this, std::move(con), std::move(clt)); } Loading client/client.h +5 −0 Changes for client/client.h: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -215,6 +215,10 @@ namespace authdb { ConnectionPool(const ConnectionPool&) = delete; ConnectionPool& operator=(const ConnectionPool&) = delete; // Configure TLS peer verification for connections created by the // pool. Applied before Client construction opens the socket. void setTlsVerify(bool verify); // Acquire a ready-to-use connection (creates new if pool empty) PooledConnection acquire(); Loading @@ -227,6 +231,7 @@ namespace authdb { std::string _CltName; std::string _CltSecret; std::size_t _MaxIdle; bool _TlsVerify = true; std::mutex _Mutex; struct IdleEntry { Loading Loading
client/client.cpp +10 −0 Changes for client/client.cpp: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1267,7 +1267,15 @@ ConnectionPool::ConnectionPool(const std::string& url, ConnectionPool::~ConnectionPool() = default; void ConnectionPool::setTlsVerify(bool verify) { std::lock_guard<std::mutex> lk(_Mutex); _TlsVerify = verify; for (auto& entry : _Idle) entry.con->setTlsVerify(verify); } PooledConnection ConnectionPool::acquire() { bool tls_verify = true; { std::lock_guard<std::mutex> lk(_Mutex); if (!_Idle.empty()) { Loading @@ -1275,12 +1283,14 @@ PooledConnection ConnectionPool::acquire() { _Idle.pop_front(); return PooledConnection(this, std::move(entry.con), std::move(entry.clt)); } tls_verify = _TlsVerify; } // Create new connection auto con = std::make_unique<ClientConnection>(); con->setUrl(_Url); con->setClientName(_CltName); con->setClientSecret(_CltSecret); con->setTlsVerify(tls_verify); auto clt = std::make_unique<Client>(*con); return PooledConnection(this, std::move(con), std::move(clt)); } Loading
client/client.h +5 −0 Changes for client/client.h: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -215,6 +215,10 @@ namespace authdb { ConnectionPool(const ConnectionPool&) = delete; ConnectionPool& operator=(const ConnectionPool&) = delete; // Configure TLS peer verification for connections created by the // pool. Applied before Client construction opens the socket. void setTlsVerify(bool verify); // Acquire a ready-to-use connection (creates new if pool empty) PooledConnection acquire(); Loading @@ -227,6 +231,7 @@ namespace authdb { std::string _CltName; std::string _CltSecret; std::size_t _MaxIdle; bool _TlsVerify = true; std::mutex _Mutex; struct IdleEntry { Loading