File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ zend_class_entry *php_driver_cluster_builder_ce = NULL;
29
29
30
30
PHP_METHOD (ClusterBuilder , build )
31
31
{
32
+ CassError rc ;
32
33
php_driver_cluster * cluster ;
33
34
php_driver_cluster_builder * self = PHP_DRIVER_GET_CLUSTER_BUILDER (getThis ());
34
35
@@ -125,7 +126,16 @@ PHP_METHOD(ClusterBuilder, build)
125
126
cass_cluster_set_tcp_nodelay (cluster -> cluster , self -> enable_tcp_nodelay );
126
127
cass_cluster_set_tcp_keepalive (cluster -> cluster , self -> enable_tcp_keepalive , self -> tcp_keepalive_delay );
127
128
cass_cluster_set_use_schema (cluster -> cluster , self -> enable_schema );
128
- ASSERT_SUCCESS (cass_cluster_set_use_hostname_resolution (cluster -> cluster , self -> enable_hostname_resolution ));
129
+
130
+ rc = cass_cluster_set_use_hostname_resolution (cluster -> cluster , self -> enable_hostname_resolution );
131
+ if (rc == CASS_ERROR_LIB_NOT_IMPLEMENTED ) {
132
+ if (self -> enable_hostname_resolution ) {
133
+ php_error_docref0 (NULL , E_WARNING ,
134
+ "The underlying C/C++ driver does not implement hostname resolution it will be disabled" );
135
+ }
136
+ } else {
137
+ ASSERT_SUCCESS (rc );
138
+ }
129
139
ASSERT_SUCCESS (cass_cluster_set_use_randomized_contact_points (cluster -> cluster , self -> enable_randomized_contact_points ));
130
140
cass_cluster_set_connection_heartbeat_interval (cluster -> cluster , self -> connection_heartbeat_interval );
131
141
Original file line number Diff line number Diff line change @@ -284,6 +284,10 @@ Cluster\Builder:
284
284
If enabled the driver will resolve hostnames for IP addresses using
285
285
reverse IP lookup. This is useful for authentication (Kerberos) or
286
286
encryption SSL services that require a valid hostname for verification.
287
+
288
+ Important: It's possible that the underlying C/C++ driver does not
289
+ support hostname resolution. A PHP warning will be emitted if the driver
290
+ does not support hostname resolution.
287
291
params :
288
292
enabled :
289
293
comment : whether the driver uses hostname resolution.
You can’t perform that action at this time.
0 commit comments