]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Add connection number config
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 Apr 2017 12:50:07 +0000 (13:50 +0100)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:55:46 +0000 (17:55 +0000)
servers/lloadd/config.c

index 066d9a27e1ca95a8f61a08c1582f67007d388bc8..0f13807d3f107243fc29026b1d25a4f710e16ea0 100644 (file)
@@ -462,6 +462,9 @@ config_backend( ConfigArgs *c )
 
     b = ch_calloc( 1, sizeof(Backend) );
 
+    b->b_numconns = 1;
+    b->b_numbindconns = 1;
+
     for ( i = 1; i < c->argc; i++ ) {
         if ( bindconf_parse( c->argv[i], b ) ) {
             Debug( LDAP_DEBUG_ANY, "config_backend: "
@@ -488,6 +491,20 @@ config_backend( ConfigArgs *c )
 #endif
     }
 
+    if ( b->b_numconns <= 0 ) {
+        Debug( LDAP_DEBUG_ANY, "config_backend: "
+                "invalid connection pool configuration\n" );
+        rc = -1;
+        goto done;
+    }
+
+    if ( b->b_numbindconns <= 0 ) {
+        Debug( LDAP_DEBUG_ANY, "config_backend: "
+                "invalid bind connection pool configuration\n" );
+        rc = -1;
+        goto done;
+    }
+
     if ( BER_BVISNULL( &b->b_bindconf.sb_uri ) ) {
         Debug( LDAP_DEBUG_ANY, "config_backend: "
                 "backend address not specified\n" );
@@ -1884,6 +1901,9 @@ static slap_cf_aux_table bindkey[] = {
     { BER_BVC("authcID="), offsetof(Backend, b_bindconf.sb_authcId), 'b', 1, NULL },
     { BER_BVC("authzID="), offsetof(Backend, b_bindconf.sb_authzId), 'b', 1, NULL },
     { BER_BVC("keepalive="), offsetof(Backend, b_bindconf.sb_keepalive), 'x', 0, (slap_verbmasks *)slap_keepalive_parse },
+
+    { BER_BVC("numconns="), offsetof(Backend, b_numconns), 'i', 0, NULL },
+    { BER_BVC("bindconns="), offsetof(Backend, b_numbindconns), 'i', 0, NULL },
 #ifdef HAVE_TLS
     { BER_BVC("starttls="), offsetof(Backend, b_bindconf.sb_tls), 'i', 0, tlskey },
     { BER_BVC("tls_cert="), offsetof(Backend, b_bindconf.sb_tls_cert), 's', 1, NULL },