Details
-
Improvement
-
Resolution: Unresolved
-
Trivial - P5
-
None
-
None
-
None
Description
Motivation
There are several functions related to SRV / TXT lookup in mongoc-client.c. They do not depend on mongoc_client_t. SRV / TXT lookup is called by calling _mongoc_client_get_rr in mongoc-topology.c.
In CDRIVER-4048, some symbols for SRV / TXT lookup were added to mongoc-topology-private.h to permit overriding the DNS resolver: _mongoc_rr_resolver_fn, mongoc_rr_data_t, and mongoc_rr_type_t.
mongoc-topology.c and mongoc-client.c are large files. Moving SRV / TXT code to a separate file should help readability.
Scope
Move MONGOC_RR_DEFAULT_BUFFER_SIZE and _mongoc_client_get_rr, and the related static methods to a new file. This could be named mongoc-dns.c, or mongoc-rr.c. If rr is the name chosen, ensure that it is clearly defined (to be "resource record" I believe).