Skip to content

Commit 0da62cf

Browse files
committed
CDRIVER-731: Do not trace SASL mutex callbacks
These callbacks may be invoked before users have a chance to set their own log handler, so we should avoid tracing them (akin to the SSL and SCRAM init functions).
1 parent 53b29b3 commit 0da62cf

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/mongoc/mongoc-init.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,36 @@ mongoc_sasl_mutex_alloc (void)
3737
{
3838
mongoc_mutex_t *mutex;
3939

40-
ENTRY;
41-
4240
mutex = bson_malloc0 (sizeof (mongoc_mutex_t));
4341
mongoc_mutex_init (mutex);
4442

45-
RETURN((void *) mutex);
43+
return (void *) mutex;
4644
}
4745

4846

4947
static int
5048
mongoc_sasl_mutex_lock (void *mutex)
5149
{
52-
ENTRY;
53-
5450
mongoc_mutex_lock ((mongoc_mutex_t *) mutex);
5551

56-
RETURN(SASL_OK);
52+
return SASL_OK;
5753
}
5854

5955

6056
static int
6157
mongoc_sasl_mutex_unlock (void *mutex)
6258
{
63-
ENTRY;
64-
6559
mongoc_mutex_unlock ((mongoc_mutex_t *) mutex);
6660

67-
RETURN(SASL_OK);
61+
return SASL_OK;
6862
}
6963

7064

7165
static void
7266
mongoc_sasl_mutex_free (void *mutex)
7367
{
74-
ENTRY;
75-
7668
mongoc_mutex_destroy ((mongoc_mutex_t *) mutex);
7769
bson_free (mutex);
78-
79-
EXIT;
8070
}
8171

8272
#endif//MONGOC_ENABLE_SASL
@@ -90,6 +80,8 @@ static MONGOC_ONCE_FUN( _mongoc_do_init)
9080
#endif
9181

9282
#ifdef MONGOC_ENABLE_SASL
83+
/* The following functions should not use tracing, as they may be invoked
84+
* before mongoc_log_set_handler() can complete. */
9385
sasl_set_mutex (mongoc_sasl_mutex_alloc,
9486
mongoc_sasl_mutex_lock,
9587
mongoc_sasl_mutex_unlock,

0 commit comments

Comments
 (0)