@@ -16,7 +16,7 @@ use scylla::load_balancing::{DefaultPolicyBuilder, LoadBalancingPolicy};
1616use scylla:: retry_policy:: RetryPolicy ;
1717use scylla:: speculative_execution:: SimpleSpeculativeExecutionPolicy ;
1818use scylla:: statement:: { Consistency , SerialConsistency } ;
19- use scylla:: SessionBuilder ;
19+ use scylla:: { SessionBuilder , SessionConfig } ;
2020use std:: collections:: HashMap ;
2121use std:: convert:: TryInto ;
2222use std:: future:: Future ;
@@ -91,6 +91,21 @@ impl CassCluster {
9191 pub ( crate ) fn execution_profile_map ( & self ) -> & HashMap < ExecProfileName , CassExecProfile > {
9292 & self . execution_profile_map
9393 }
94+
95+ #[ inline]
96+ pub ( crate ) fn get_session_config ( & self ) -> & SessionConfig {
97+ & self . session_builder . config
98+ }
99+
100+ #[ inline]
101+ pub ( crate ) fn get_port ( & self ) -> u16 {
102+ self . port
103+ }
104+
105+ #[ inline]
106+ pub ( crate ) fn get_contact_points ( & self ) -> & [ String ] {
107+ & self . contact_points
108+ }
94109}
95110
96111pub struct CassCustomPayload ;
@@ -174,9 +189,10 @@ unsafe fn cluster_set_contact_points(
174189 let mut contact_points = ptr_to_cstr_n ( contact_points_raw, contact_points_length)
175190 . ok_or ( CassError :: CASS_ERROR_LIB_BAD_PARAMS ) ?
176191 . split ( ',' )
192+ . filter ( |s| !s. is_empty ( ) ) // Extra commas should be ignored.
177193 . peekable ( ) ;
178194
179- if contact_points. peek ( ) . is_none ( ) {
195+ if contact_points. peek ( ) . is_none ( ) || contact_points . peek ( ) . unwrap ( ) . is_empty ( ) {
180196 // If cass_cluster_set_contact_points() is called with empty
181197 // set of contact points, the contact points should be cleared.
182198 cluster. contact_points . clear ( ) ;
0 commit comments