Skip to content

Commit 256b0a2

Browse files
committed
CPP-499: Further review markups.
1 parent 3a460f6 commit 256b0a2

3 files changed

Lines changed: 22 additions & 24 deletions

File tree

gtests/src/integration/tests/test_control_connection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ CASSANDRA_INTEGRATION_TEST_F(ControlConnectionTests,
587587
CHECK_FAILURE;
588588

589589
// Stop the cluster and attempt to perform a request
590+
connect();
590591
ccm_->stop_cluster();
591592
Result result = session_.execute(SELECT_ALL_SYSTEM_LOCAL_CQL,
592593
CASS_CONSISTENCY_ONE, false, false);

include/cassandra.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -947,37 +947,37 @@ cass_cluster_set_port(CassCluster* cluster,
947947
int port);
948948

949949
/**
950-
* Same as cass_cluster_set_local_address(), but with lengths for string
951-
* parameters.
950+
* Sets the local address to bind when connecting to the cluster,
951+
* if desired.
952952
*
953953
* @public @memberof CassCluster
954954
*
955955
* @param[in] cluster
956-
* @param[in] name
957-
* @param[in] name_length
958-
* @return same as cass_cluster_set_local_address()
959-
*
960-
* @see cass_cluster_set_local_address()
956+
* @param[in] name IP address to bind, or empty string for no binding.
957+
* Only numeric addresses are supported; no resolution is done.
958+
* @return CASS_OK if successful, otherwise an error occurred.
961959
*/
962960
CASS_EXPORT CassError
963-
cass_cluster_set_local_address_n(CassCluster* cluster,
964-
const char* name,
965-
size_t name_length);
961+
cass_cluster_set_local_address(CassCluster* cluster,
962+
const char* name);
966963

967964
/**
968-
* Sets the local address to bind when connecting to the cluster,
969-
* if desired.
965+
* Same as cass_cluster_set_local_address(), but with lengths for string
966+
* parameters.
970967
*
971968
* @public @memberof CassCluster
972969
*
973970
* @param[in] cluster
974-
* @param[in] name IP address to bind, or empty string for no binding.
975-
* Only numeric addresses are supported; no resolution is done.
976-
* @return CASS_OK if successful, otherwise an error occurred.
971+
* @param[in] name
972+
* @param[in] name_length
973+
* @return same as cass_cluster_set_local_address()
974+
*
975+
* @see cass_cluster_set_local_address()
977976
*/
978977
CASS_EXPORT CassError
979-
cass_cluster_set_local_address(CassCluster* cluster,
980-
const char* name);
978+
cass_cluster_set_local_address_n(CassCluster* cluster,
979+
const char* name,
980+
size_t name_length);
981981

982982
/**
983983
* Sets the SSL context and enables SSL.

src/connection.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ Connection::Connection(uv_loop_t* loop,
232232
, heartbeat_outstanding_(false) {
233233
socket_.data = this;
234234
uv_tcp_init(loop_, &socket_);
235-
bool ok = true;
236235

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

257-
if (ok) {
258-
SslContext* ssl_context = config_.ssl_context();
259-
if (ssl_context != NULL) {
260-
ssl_session_.reset(ssl_context->create_session(host));
261-
}
256+
SslContext* ssl_context = config_.ssl_context();
257+
if (ssl_context != NULL) {
258+
ssl_session_.reset(ssl_context->create_session(host));
262259
}
263260
}
264261

0 commit comments

Comments
 (0)