@@ -285,10 +285,11 @@ mongoc_cluster_run_command_opquery (mongoc_cluster_t *cluster,
285
285
_mongoc_rpc_gather (& rpc , & cluster -> iov );
286
286
_mongoc_rpc_swab_to_le (& rpc );
287
287
288
- if (compressor_id != -1 && IS_NOT_COMMAND ("ismaster" ) &&
289
- IS_NOT_COMMAND ("saslstart" ) && IS_NOT_COMMAND ("saslcontinue" ) &&
290
- IS_NOT_COMMAND ("getnonce" ) && IS_NOT_COMMAND ("authenticate" ) &&
291
- IS_NOT_COMMAND ("createuser" ) && IS_NOT_COMMAND ("updateuser" )) {
288
+ if (compressor_id != -1 && IS_NOT_COMMAND (HANDSHAKE_CMD_LEGACY_HELLO ) &&
289
+ IS_NOT_COMMAND ("hello" ) && IS_NOT_COMMAND ("saslstart" ) &&
290
+ IS_NOT_COMMAND ("saslcontinue" ) && IS_NOT_COMMAND ("getnonce" ) &&
291
+ IS_NOT_COMMAND ("authenticate" ) && IS_NOT_COMMAND ("createuser" ) &&
292
+ IS_NOT_COMMAND ("updateuser" )) {
292
293
output = _mongoc_rpc_compress (cluster , compressor_id , & rpc , error );
293
294
if (output == NULL ) {
294
295
GOTO (done );
@@ -730,11 +731,11 @@ mongoc_cluster_run_command_parts (mongoc_cluster_t *cluster,
730
731
/*
731
732
*--------------------------------------------------------------------------
732
733
*
733
- * _mongoc_stream_run_ismaster --
734
+ * _mongoc_stream_run_hello --
734
735
*
735
- * Run an ismaster command on the given stream. If
736
+ * Run a hello command on the given stream. If
736
737
* @negotiate_sasl_supported_mechs is true, then saslSupportedMechs is
737
- * added to the ismaster command.
738
+ * added to the hello command.
738
739
*
739
740
* Returns:
740
741
* A mongoc_server_description_t you must destroy or NULL. If the call
@@ -743,18 +744,18 @@ mongoc_cluster_run_command_parts (mongoc_cluster_t *cluster,
743
744
*--------------------------------------------------------------------------
744
745
*/
745
746
static mongoc_server_description_t *
746
- _mongoc_stream_run_ismaster (mongoc_cluster_t * cluster ,
747
- mongoc_stream_t * stream ,
748
- const char * address ,
749
- uint32_t server_id ,
750
- bool negotiate_sasl_supported_mechs ,
751
- mongoc_scram_cache_t * scram_cache ,
752
- mongoc_scram_t * scram ,
753
- bson_t * speculative_auth_response /* OUT */ ,
754
- bson_error_t * error )
747
+ _mongoc_stream_run_hello (mongoc_cluster_t * cluster ,
748
+ mongoc_stream_t * stream ,
749
+ const char * address ,
750
+ uint32_t server_id ,
751
+ bool negotiate_sasl_supported_mechs ,
752
+ mongoc_scram_cache_t * scram_cache ,
753
+ mongoc_scram_t * scram ,
754
+ bson_t * speculative_auth_response /* OUT */ ,
755
+ bson_error_t * error )
755
756
{
756
757
const bson_t * command ;
757
- mongoc_cmd_t ismaster_cmd ;
758
+ mongoc_cmd_t hello_cmd ;
758
759
bson_t reply ;
759
760
int64_t start ;
760
761
int64_t rtt_msec ;
@@ -813,15 +814,15 @@ _mongoc_stream_run_ismaster (mongoc_cluster_t *cluster,
813
814
* last known ismaster indicates the server supports a newer wire protocol.
814
815
*/
815
816
server_stream -> sd -> max_wire_version = WIRE_VERSION_MIN ;
816
- memset (& ismaster_cmd , 0 , sizeof (ismaster_cmd ));
817
- ismaster_cmd .db_name = "admin" ;
818
- ismaster_cmd .command = command ;
819
- ismaster_cmd .command_name = _mongoc_get_command_name (command );
820
- ismaster_cmd .query_flags = MONGOC_QUERY_SLAVE_OK ;
821
- ismaster_cmd .server_stream = server_stream ;
817
+ memset (& hello_cmd , 0 , sizeof (hello_cmd ));
818
+ hello_cmd .db_name = "admin" ;
819
+ hello_cmd .command = command ;
820
+ hello_cmd .command_name = _mongoc_get_command_name (command );
821
+ hello_cmd .query_flags = MONGOC_QUERY_SLAVE_OK ;
822
+ hello_cmd .server_stream = server_stream ;
822
823
823
824
if (!mongoc_cluster_run_command_private (
824
- cluster , & ismaster_cmd , & reply , error )) {
825
+ cluster , & hello_cmd , & reply , error )) {
825
826
if (negotiate_sasl_supported_mechs ) {
826
827
if (bson_iter_init_find (& iter , & reply , "ok" ) &&
827
828
!bson_iter_as_bool (& iter )) {
@@ -845,8 +846,8 @@ _mongoc_stream_run_ismaster (mongoc_cluster_t *cluster,
845
846
sizeof (mongoc_server_description_t ));
846
847
847
848
mongoc_server_description_init (sd , address , server_id );
848
- /* send the error from run_command IN to handle_ismaster */
849
- mongoc_server_description_handle_ismaster (sd , & reply , rtt_msec , error );
849
+ /* send the error from run_command IN to handle_hello */
850
+ mongoc_server_description_handle_hello (sd , & reply , rtt_msec , error );
850
851
851
852
if (cluster -> requires_auth && speculative_auth_response ) {
852
853
_mongoc_topology_scanner_parse_speculative_authentication (
@@ -877,28 +878,28 @@ _mongoc_stream_run_ismaster (mongoc_cluster_t *cluster,
877
878
/*
878
879
*--------------------------------------------------------------------------
879
880
*
880
- * _mongoc_cluster_run_ismaster --
881
+ * _mongoc_cluster_run_hello --
881
882
*
882
- * Run an initial ismaster command for the given node and handle result.
883
+ * Run an initial hello command for the given node and handle result.
883
884
*
884
885
* Returns:
885
886
* mongoc_server_description_t on success, NULL otherwise.
886
887
* the mongoc_server_description_t MUST BE DESTROYED BY THE CALLER.
887
888
*
888
889
* Side effects:
889
890
* Makes a blocking I/O call, updates cluster->topology->description
890
- * with ismaster result.
891
+ * with hello result.
891
892
*
892
893
*--------------------------------------------------------------------------
893
894
*/
894
895
static mongoc_server_description_t *
895
- _mongoc_cluster_run_ismaster (mongoc_cluster_t * cluster ,
896
- mongoc_cluster_node_t * node ,
897
- uint32_t server_id ,
898
- mongoc_scram_cache_t * scram_cache ,
899
- mongoc_scram_t * scram /* OUT */ ,
900
- bson_t * speculative_auth_response /* OUT */ ,
901
- bson_error_t * error /* OUT */ )
896
+ _mongoc_cluster_run_hello (mongoc_cluster_t * cluster ,
897
+ mongoc_cluster_node_t * node ,
898
+ uint32_t server_id ,
899
+ mongoc_scram_cache_t * scram_cache ,
900
+ mongoc_scram_t * scram /* OUT */ ,
901
+ bson_t * speculative_auth_response /* OUT */ ,
902
+ bson_error_t * error /* OUT */ )
902
903
{
903
904
mongoc_server_description_t * sd ;
904
905
@@ -908,7 +909,7 @@ _mongoc_cluster_run_ismaster (mongoc_cluster_t *cluster,
908
909
BSON_ASSERT (node );
909
910
BSON_ASSERT (node -> stream );
910
911
911
- sd = _mongoc_stream_run_ismaster (
912
+ sd = _mongoc_stream_run_hello (
912
913
cluster ,
913
914
node -> stream ,
914
915
node -> connection_address ,
@@ -2095,18 +2096,18 @@ _mongoc_cluster_add_node (mongoc_cluster_t *cluster,
2095
2096
cluster_node =
2096
2097
_mongoc_cluster_node_new (stream , generation , host -> host_and_port );
2097
2098
2098
- sd = _mongoc_cluster_run_ismaster (cluster ,
2099
- cluster_node ,
2100
- server_id ,
2101
- cluster -> scram_cache ,
2102
- & scram ,
2103
- & speculative_auth_response ,
2104
- error );
2099
+ sd = _mongoc_cluster_run_hello (cluster ,
2100
+ cluster_node ,
2101
+ server_id ,
2102
+ cluster -> scram_cache ,
2103
+ & scram ,
2104
+ & speculative_auth_response ,
2105
+ error );
2105
2106
if (!sd ) {
2106
2107
GOTO (error );
2107
2108
}
2108
2109
2109
- _mongoc_handshake_parse_sasl_supported_mechs (& sd -> last_is_master ,
2110
+ _mongoc_handshake_parse_sasl_supported_mechs (& sd -> last_hello_response ,
2110
2111
& sasl_supported_mechs );
2111
2112
2112
2113
if (cluster -> requires_auth ) {
0 commit comments