Simplify the test code command again
Internal isMaster commands should not be compressed, but user triggered
isMaster is fair game. We previously had asserts to ensure no
non-compressable commands would get compressed, which this check
would hit. Now that check has been removed and no longer need for this
workaround
@@ -971,7 +971,6 @@ call_ismaster_with_host_and_port (char *host, uint16_t port, bson_t *reply)
mongoc_uri_t *uri;
mongoc_client_t *client;
bson_error_t error;
- mongoc_server_stream_t *server_stream = NULL;
uri_str = bson_strdup_printf ("mongodb://%s:%hu%s",
host,
@@ -997,23 +996,12 @@ call_ismaster_with_host_and_port (char *host, uint16_t port, bson_t *reply)
test_framework_set_ssl_opts (client);
#endif
-
- server_stream =
- mongoc_cluster_stream_for_reads (&client->cluster, NULL, &error);
- if (!server_stream ||
- !mongoc_cluster_run_command_private (&client->cluster,
- server_stream->stream,
- 0,
- MONGOC_QUERY_SLAVE_OK,
- "admin",
- tmp_bson ("{'isMaster': 1}"),
- reply,
- &error)) {
+ if (!mongoc_client_command_simple (
+ client, "admin", tmp_bson ("{'isMaster': 1}"), NULL, reply, &error)) {
fprintf (stderr, "error calling ismaster: '%s'\n", error.message);
fprintf (stderr, "URI = %s\n", uri_str);
abort ();
}
- mongoc_server_stream_cleanup (server_stream);
mongoc_client_destroy (client);
mongoc_uri_destroy (uri);
