Skip to content

Commit

Permalink
CPP-499: Further review markups.
Browse files Browse the repository at this point in the history
  • Loading branch information
kw217 committed Apr 20, 2018
1 parent 3a460f6 commit 256b0a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
1 change: 1 addition & 0 deletions gtests/src/integration/tests/test_control_connection.cpp
Expand Up @@ -587,6 +587,7 @@ CASSANDRA_INTEGRATION_TEST_F(ControlConnectionTests,
CHECK_FAILURE;

// Stop the cluster and attempt to perform a request
connect();
ccm_->stop_cluster();
Result result = session_.execute(SELECT_ALL_SYSTEM_LOCAL_CQL,
CASS_CONSISTENCY_ONE, false, false);
Expand Down
34 changes: 17 additions & 17 deletions include/cassandra.h
Expand Up @@ -947,37 +947,37 @@ cass_cluster_set_port(CassCluster* cluster,
int port);

/**
* Same as cass_cluster_set_local_address(), but with lengths for string
* parameters.
* Sets the local address to bind when connecting to the cluster,
* if desired.
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] name
* @param[in] name_length
* @return same as cass_cluster_set_local_address()
*
* @see cass_cluster_set_local_address()
* @param[in] name IP address to bind, or empty string for no binding.
* Only numeric addresses are supported; no resolution is done.
* @return CASS_OK if successful, otherwise an error occurred.
*/
CASS_EXPORT CassError
cass_cluster_set_local_address_n(CassCluster* cluster,
const char* name,
size_t name_length);
cass_cluster_set_local_address(CassCluster* cluster,
const char* name);

/**
* Sets the local address to bind when connecting to the cluster,
* if desired.
* Same as cass_cluster_set_local_address(), but with lengths for string
* parameters.
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] name IP address to bind, or empty string for no binding.
* Only numeric addresses are supported; no resolution is done.
* @return CASS_OK if successful, otherwise an error occurred.
* @param[in] name
* @param[in] name_length
* @return same as cass_cluster_set_local_address()
*
* @see cass_cluster_set_local_address()
*/
CASS_EXPORT CassError
cass_cluster_set_local_address(CassCluster* cluster,
const char* name);
cass_cluster_set_local_address_n(CassCluster* cluster,
const char* name,
size_t name_length);

/**
* Sets the SSL context and enables SSL.
Expand Down
11 changes: 4 additions & 7 deletions src/connection.cpp
Expand Up @@ -232,7 +232,6 @@ Connection::Connection(uv_loop_t* loop,
, heartbeat_outstanding_(false) {
socket_.data = this;
uv_tcp_init(loop_, &socket_);
bool ok = true;

if (uv_tcp_nodelay(&socket_,
config.tcp_nodelay_enable() ? 1 : 0) != 0) {
Expand All @@ -249,16 +248,14 @@ Connection::Connection(uv_loop_t* loop,
if (local_address) {
int rc = uv_tcp_bind(&socket_, local_address->addr(), 0);
if (rc) {
ok = false;
notify_error("Unable to bind local address: " + std::string(UV_ERRSTR(rc, loop_)));
return;
}
}

if (ok) {
SslContext* ssl_context = config_.ssl_context();
if (ssl_context != NULL) {
ssl_session_.reset(ssl_context->create_session(host));
}
SslContext* ssl_context = config_.ssl_context();
if (ssl_context != NULL) {
ssl_session_.reset(ssl_context->create_session(host));
}
}

Expand Down

0 comments on commit 256b0a2

Please sign in to comment.