Skip to content

Commit

Permalink
GEODE-9551: Fixes API return and parameter types. (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-at-work committed Aug 27, 2021
1 parent 597ab21 commit 4ccd5f7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
8 changes: 2 additions & 6 deletions cppcache/include/geode/Pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include "internal/geode_base.hpp"
#include "internal/geode_globals.hpp"

/**
* @file
*/

namespace apache {
namespace geode {
namespace client {
Expand Down Expand Up @@ -98,13 +94,13 @@ class APACHE_GEODE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
* Gets the host name of the SniProxy.
* @see PoolFactory#setSniProxy(string, int)
*/
std::string getSniProxyHost() const;
const std::string& getSniProxyHost() const;

/**
* Gets the port of the SniProxy.
* @see PoolFactory#setSniProxy(string, int)
*/
int getSniProxyPort() const;
uint16_t getSniProxyPort() const;

/**
* Gets the minimum connections for this pool.
Expand Down
2 changes: 1 addition & 1 deletion cppcache/include/geode/PoolFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class APACHE_GEODE_EXPORT PoolFactory {
/**
* Set proxy info for SNI connection. Used for connecting via SNI proxy.
*/
PoolFactory& setSniProxy(const std::string& hostname, const int port);
PoolFactory& setSniProxy(std::string hostname, uint16_t port);

/**
* If set to <code>true</code> then the created pool will have
Expand Down
7 changes: 5 additions & 2 deletions cppcache/src/Pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ std::chrono::milliseconds Pool::getReadTimeout() const {
return m_attrs->getReadTimeout();
}

std::string Pool::getSniProxyHost() const { return m_attrs->getSniProxyHost(); }
int Pool::getSniProxyPort() const { return m_attrs->getSniProxyPort(); }
const std::string& Pool::getSniProxyHost() const {
return m_attrs->getSniProxyHost();
}

uint16_t Pool::getSniProxyPort() const { return m_attrs->getSniProxyPort(); }

int Pool::getMinConnections() const { return m_attrs->getMinConnections(); }

Expand Down
8 changes: 4 additions & 4 deletions cppcache/src/PoolAttributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ class PoolAttributes {

const std::string& getSniProxyHost() const { return m_sniProxyHost; }

void setSniProxyHost(const std::string& host) { m_sniProxyHost = host; }
void setSniProxyHost(std::string host) { m_sniProxyHost = std::move(host); }

int getSniProxyPort() const { return m_sniProxyPort; }
uint16_t getSniProxyPort() const { return m_sniProxyPort; }

void setSniProxyPort(const int port) { m_sniProxyPort = port; }
void setSniProxyPort(const uint16_t port) { m_sniProxyPort = port; }

const std::string& getServerGroup() const { return m_serverGrp; }

Expand Down Expand Up @@ -203,7 +203,7 @@ class PoolAttributes {
std::vector<std::string> m_initServList;

std::string m_sniProxyHost;
int m_sniProxyPort;
uint16_t m_sniProxyPort;

static bool compareVectorOfStrings(
const std::vector<std::string>& thisVector,
Expand Down
5 changes: 2 additions & 3 deletions cppcache/src/PoolFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ PoolFactory& PoolFactory::addServer(const std::string& host, int port) {
return *this;
}

PoolFactory& PoolFactory::setSniProxy(const std::string& hostname,
const int port) {
m_attrs->setSniProxyHost(hostname);
PoolFactory& PoolFactory::setSniProxy(std::string hostname, uint16_t port) {
m_attrs->setSniProxyHost(std::move(hostname));
m_attrs->setSniProxyPort(port);
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions cppcache/src/TcrConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ void TcrConnection::createConnection(const std::string& address,
.getSystemProperties();

if (systemProperties.sslEnabled()) {
auto sniHostname = m_poolDM->getSNIProxyHostname();
auto sniPort = m_poolDM->getSNIPort();
const auto& sniHostname = m_poolDM->getSniProxyHost();
if (sniHostname.empty()) {
m_conn.reset(new TcpSslConn(address, connectTimeout, maxBuffSizePool,
systemProperties.sslTrustStore(),
systemProperties.sslKeyStore(),
systemProperties.sslKeystorePassword()));
} else {
const auto sniPort = m_poolDM->getSniProxyPort();
m_conn.reset(new TcpSslConn(
address, connectTimeout, maxBuffSizePool, sniHostname, sniPort,
systemProperties.sslTrustStore(), systemProperties.sslKeyStore(),
Expand Down
2 changes: 0 additions & 2 deletions cppcache/src/ThinClientPoolDM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ class ThinClientPoolDM
GfErrType getConnectionToAnEndPoint(std::string epNameStr,
TcrConnection*& conn);

const std::string getSNIProxyHostname() { return m_attrs->getSniProxyHost(); }
uint16_t getSNIPort() { return m_attrs->getSniProxyPort(); }
virtual inline bool isSticky() { return m_sticky; }
virtual TcrEndpoint* getEndPoint(
const std::shared_ptr<BucketServerLocation>& serverLocation,
Expand Down

0 comments on commit 4ccd5f7

Please sign in to comment.