You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDRIVER-938 prohibit calling unsafe client setters with pooled clients (#1944)
* log and return on bad calls with a pooled client
** reject a pooled client in `mongoc_client_set_ssl_opts` and `mongoc_client_set_stream_initiator`
* fix test calling `mongoc_client_set_stream_initiator` on a pooled client
* add doc notices
* New behavior: `authMechanismProperties=A:B,C:D:E,F:G` is parsed as `{'A': 'B': 'C': 'D:E', 'F': 'G'}`.
45
45
* Calling `mongoc_bulk_operation_execute` on the same `mongoc_bulk_operation_t` repeatedly is an error. Previously this was only discouraged in documentation.
46
46
* Consistently apply `__cdecl` calling convention to function declarations in public API. Intended to support consumers building their code using a different [default calling convention](https://learn.microsoft.com/en-us/cpp/build/reference/gd-gr-gv-gz-calling-convention) with MSVC. The mongoc and bson libraries only support being built with the `__cdecl` default calling convention.
47
+
* `mongoc_client_set_ssl_opts` now ignores a pooled `mongoc_client_t` and logs an error. Use `mongoc_client_pool_set_ssl_opts` to set TLS options on a `mongoc_client_pool_t` before popping any clients.
48
+
* `mongoc_client_set_ssl_stream_initiator` now ignores a pooled `mongoc_client_t` and logs an error.
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_client_set_ssl_opts.rst
+2
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ It is a programming error to call this function on a client from a
32
32
:symbol:`mongoc_client_pool_set_ssl_opts` on the pool before popping any
33
33
clients.
34
34
35
+
.. versionchanged:: 2.0.0 This function logs an error and immediately returns if ``client`` is from a :symbol:`mongoc_client_pool_t`. Previously this function unsafely applied the options to the pooled client.
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_client_set_stream_initiator.rst
+4
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ Synopsis
15
15
16
16
The :symbol:`mongoc_client_set_stream_initiator()` function shall associate a given :symbol:`mongoc_client_t` with a new stream initiator. This will completely replace the default transport (buffered TCP, possibly with TLS). The ``initiator`` should fulfill the :symbol:`mongoc_stream_t` contract. ``user_data`` is passed through to the ``initiator`` callback and may be used for whatever run time customization is necessary.
17
17
18
+
It is a programming error to call this function on a :symbol:`mongoc_client_t` from a :symbol:`mongoc_client_pool_t`.
19
+
20
+
.. versionchanged:: 2.0.0 This function logs an error and immediately returns if ``client`` is from a :symbol:`mongoc_client_pool_t`. Previously this function unsafely applied the initiator to the pooled client.
21
+
18
22
If ``user_data`` is passed, it is the application's responsibility to ensure ``user_data`` remains valid for the lifetime of the client.
0 commit comments