Skip to content

Commit 5f9d09a

Browse files
Remove mlib for now
1 parent 834308f commit 5f9d09a

19 files changed

+15
-1825
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@ endif ()
761761
add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
762762
set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
763763
target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES})
764-
targets_use_mlib (mongoc_shared)
765764
target_include_directories (mongoc_shared BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS})
766765
target_include_directories (mongoc_shared PRIVATE ${ZLIB_INCLUDE_DIRS})
767766
target_include_directories (mongoc_shared PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES})
@@ -800,7 +799,6 @@ set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BAS
800799
if (MONGOC_ENABLE_STATIC_BUILD)
801800
add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
802801
target_link_libraries (mongoc_static PUBLIC ${STATIC_LIBRARIES} ${BSON_STATIC_LIBRARIES})
803-
targets_use_mlib (mongoc_static)
804802
if (NOT WIN32 AND ENABLE_PIC)
805803
target_compile_options (mongoc_static PUBLIC -fPIC)
806804
message ("Adding -fPIC to compilation of mongoc_static components")
@@ -1059,9 +1057,7 @@ endif ()
10591057
mongoc_add_test (test-libmongoc FALSE ${test-libmongoc-sources})
10601058
mongoc_add_test (test-mongoc-gssapi FALSE ${PROJECT_SOURCE_DIR}/tests/test-mongoc-gssapi.c)
10611059
mongoc_add_test (test-mongoc-cache FALSE ${PROJECT_SOURCE_DIR}/tests/test-mongoc-cache.c)
1062-
if (TARGET test-libmongoc)
1063-
targets_use_mlib (test-libmongoc)
1064-
endif ()
1060+
10651061

10661062
if (ENABLE_TESTS)
10671063
# "make test" doesn't compile tests, so we create "make check" which compiles

src/libmongoc/src/mongoc/mongoc-client-side-encryption.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,8 +1192,8 @@ _parse_extra (const bson_t *extra,
11921192
}
11931193
uint32_t len;
11941194
const char *ptr = bson_iter_utf8 (&iter, &len);
1195-
mstr_assign (&topology->csfle_override_path,
1196-
mstr_copy_data (ptr, len));
1195+
bson_free (topology->csfle_override_path);
1196+
topology->csfle_override_path = bson_strdup (ptr);
11971197
}
11981198

11991199
if (bson_iter_init_find (&iter, extra, "csfleRequired")) {
@@ -1310,7 +1310,7 @@ _mongoc_cse_client_enable_auto_encryption (mongoc_client_t *client,
13101310
_mongoc_crypt_new (opts->kms_providers,
13111311
opts->schema_map,
13121312
opts->tls_opts,
1313-
client->topology->csfle_override_path.view,
1313+
client->topology->csfle_override_path,
13141314
client->topology->csfle_required,
13151315
error);
13161316
if (!client->topology->crypt) {
@@ -1458,7 +1458,7 @@ _mongoc_cse_client_pool_enable_auto_encryption (
14581458
topology->crypt = _mongoc_crypt_new (opts->kms_providers,
14591459
opts->schema_map,
14601460
opts->tls_opts,
1461-
topology->csfle_override_path.view,
1461+
topology->csfle_override_path,
14621462
topology->csfle_required,
14631463
error);
14641464
if (!topology->crypt) {
@@ -1551,7 +1551,7 @@ mongoc_client_encryption_new (mongoc_client_encryption_opts_t *opts,
15511551
client_encryption->crypt = _mongoc_crypt_new (opts->kms_providers,
15521552
NULL /* schema_map */,
15531553
opts->tls_opts,
1554-
MSTRV_NULL /* No csfle path */,
1554+
NULL /* No csfle path */,
15551555
false /* csfle not requried */,
15561556
error);
15571557
if (!client_encryption->crypt) {

src/libmongoc/src/mongoc/mongoc-crypt-private.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
#include "mongoc.h"
2727

28-
#include <mlib/str.h>
29-
3028
/* For interacting with libmongocrypt */
3129
typedef struct __mongoc_crypt_t _mongoc_crypt_t;
3230

@@ -39,7 +37,7 @@ _mongoc_crypt_t *
3937
_mongoc_crypt_new (const bson_t *kms_providers,
4038
const bson_t *schema_map,
4139
const bson_t *tls_opts,
42-
mstr_view csfle_override_path,
40+
const char *csfle_override_path,
4341
bool csfle_required,
4442
bson_error_t *error);
4543

src/libmongoc/src/mongoc/mongoc-crypt.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ _mongoc_crypt_t *
910910
_mongoc_crypt_new (const bson_t *kms_providers,
911911
const bson_t *schema_map,
912912
const bson_t *tls_opts,
913-
mstr_view csfle_override_path,
913+
const char *csfle_override_path,
914914
bool csfle_required,
915915
bson_error_t *error)
916916
{
@@ -952,9 +952,9 @@ _mongoc_crypt_new (const bson_t *kms_providers,
952952
goto fail;
953953
}
954954

955-
if (csfle_override_path.data != NULL) {
955+
if (csfle_override_path != NULL) {
956956
mongocrypt_setopt_set_csfle_lib_path_override (crypt->handle,
957-
csfle_override_path.data);
957+
csfle_override_path);
958958
if (!_crypt_check_error (crypt->handle, error, false)) {
959959
goto fail;
960960
}
@@ -966,9 +966,8 @@ _mongoc_crypt_new (const bson_t *kms_providers,
966966
}
967967

968968
if (csfle_required) {
969-
mstr_view s = mstrv_view_cstr (
970-
mongocrypt_csfle_version_string (crypt->handle, NULL));
971-
if (s.len == 0) {
969+
const char *s = mongocrypt_csfle_version_string (crypt->handle, NULL);
970+
if (!s || strlen (s) == 0) {
972971
// empty/null version string indicates that csfle was not loaded by
973972
// libmongocrypt
974973
bson_set_error (error,
@@ -981,7 +980,7 @@ _mongoc_crypt_new (const bson_t *kms_providers,
981980
mongoc_log (MONGOC_LOG_LEVEL_DEBUG,
982981
MONGOC_LOG_DOMAIN,
983982
"csfle version '%s' was found and loaded",
984-
s.data);
983+
s);
985984
}
986985

987986
success = true;

src/libmongoc/src/mongoc/mongoc-topology-private.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include "mongoc-ts-pool-private.h"
3131
#include "mongoc-shared-private.h"
3232

33-
#include <mlib/str.h>
34-
3533
#define MONGOC_TOPOLOGY_MIN_HEARTBEAT_FREQUENCY_MS 500
3634
#define MONGOC_TOPOLOGY_SOCKET_CHECK_INTERVAL_MS 5000
3735
#define MONGOC_TOPOLOGY_COOLDOWN_MS 5000
@@ -190,7 +188,7 @@ typedef struct _mongoc_topology_t {
190188
#endif
191189

192190
// Corresponds to extraOptions.csflePath
193-
mstr csfle_override_path;
191+
char *csfle_override_path;
194192
// Corresponds to extraOptions.csfleRequired
195193
bool csfle_required;
196194

src/libmongoc/src/mongoc/mongoc-topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ mongoc_topology_destroy (mongoc_topology_t *topology)
696696
mongoc_shared_ptr_reset_null (&topology->_shared_descr_._sptr_);
697697
mongoc_topology_scanner_destroy (topology->scanner);
698698
mongoc_server_session_pool_free (topology->session_pool);
699-
mstr_free (topology->csfle_override_path);
699+
bson_free (topology->csfle_override_path);
700700

701701
mongoc_cond_destroy (&topology->cond_client);
702702
bson_mutex_destroy (&topology->tpld_modification_mtx);

src/mlib/error.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/mlib/linkcheck-1.test.c

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/mlib/linkcheck-2.test.c

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/mlib/linkcheck.test.c

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/mlib/macros.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/mlib/mlib.cmake

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)