{ .type = SET_FILTER_NAME, .key = "userdb_ldap", },
DEF(STR, hosts),
DEF(STR, uris),
+ DEF(STR, connection_group),
DEF(STR, auth_dn),
DEF(STR, auth_dn_password),
DEF(STR, auth_sasl_mechanism),
static const struct ldap_settings ldap_default_settings = {
.hosts = "",
.uris = "",
+ .connection_group = "",
.auth_dn = "",
.auth_dn_password = "",
.auth_sasl_mechanism = "",
const char *hosts;
const char *uris;
+
+ /* This field prevents ldap_conn_find() from reusing the same
+ connection across stanzas that would otherwise do it.
+
+ Settings with different connection_group will NOT share the
+ connections, allowing parallel async execution if configured.
+
+ Note that this field is not explicitly used anywhere, but it
+ affects how ldap_conn_find() compares the settings against an
+ existing connection */
+ const char *connection_group;
+
const char *auth_dn;
const char *auth_dn_password;
static struct ldap_connection *
db_ldap_conn_find(const struct ldap_settings *set, const struct ssl_settings *ssl_set)
{
+ /* Note that set->connection_group is implicitly used to control
+ which settings can chare the same connections. Settings with
+ different values for set->connection_group will NOT share
+ the connection. */
struct ldap_connection *conn;
for (conn = ldap_connections; conn != NULL; conn = conn->next) {
if (settings_equal(&ldap_setting_parser_info, set, conn->set, NULL) &&