-#ifdef SLAP_MULTI_CONN_ARRAY
-{
- int i, j;
- Connection* conn;
-
- assert( connections == NULL );
-
- if( connections != NULL) {
- Debug( LDAP_DEBUG_ANY, "connections_init: already initialized.\n",
- 0, 0, 0 );
- return -1;
- }
-
- connections_mutex = (ldap_pvt_thread_mutex_t*) ch_calloc(
- NUM_CONNECTION_ARRAY, sizeof(ldap_pvt_thread_mutex_t) );
- if( connections_mutex == NULL ) {
- Debug( LDAP_DEBUG_ANY, "connections_init: "
- "allocation of connection mutexes failed\n", 0, 0, 0 );
- return -1;
- }
-
- connections = (Connection**) ch_calloc(
- NUM_CONNECTION_ARRAY, sizeof(Connection*));
- if( connections == NULL ) {
- Debug( LDAP_DEBUG_ANY, "connections_init: "
- "allocation of connection[%d] failed\n", 0, 0, 0 );
- return -1;
- }
-
- for ( i = 0; i < NUM_CONNECTION_ARRAY; i++ ) {
- ldap_pvt_thread_mutex_init( connections_mutex+i );
- connections[i] = (Connection*) ch_calloc(
- MCA_ARRAY_SIZE, sizeof(Connection) );
- if( connections[i] == NULL ) {
- Debug( LDAP_DEBUG_ANY, "connections_init: "
- "allocation (%d*%ld) of connection array[%d] failed\n",
- dtblsize, (long) sizeof(Connection), i );
- return -1;
- }
- }
-
- /* should check return of every call */
- ldap_pvt_thread_mutex_init( &conn_nextid_mutex );
-
- assert( connections[0]->c_struct_state == SLAP_C_UNINITIALIZED );
- assert( connections[NUM_CONNECTION_ARRAY-1]->c_struct_state ==
- SLAP_C_UNINITIALIZED );
-
- for ( i = 0; i < NUM_CONNECTION_ARRAY; i++ ) {
- conn = connections[i];
- for ( j = 0; j < MCA_ARRAY_SIZE; j++ ) {
- conn[j].c_conn_idx = j;
- }
- }
-
- /*
- * per entry initialization of the Connection array initialization
- * will be done by connection_init()
- */
-
- return 0;
-}
-#else