mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
appropriately detect the required conn
This commit is contained in:
parent
6c589f2552
commit
068c73b01f
@ -38,6 +38,8 @@
|
|||||||
#include "slap.h"
|
#include "slap.h"
|
||||||
#include "back-monitor.h"
|
#include "back-monitor.h"
|
||||||
|
|
||||||
|
#define CONN_CN_PREFIX "Connection"
|
||||||
|
|
||||||
int
|
int
|
||||||
monitor_subsys_conn_init(
|
monitor_subsys_conn_init(
|
||||||
BackendDB *be
|
BackendDB *be
|
||||||
@ -257,9 +259,9 @@ conn_create(
|
|||||||
assert( ep != NULL );
|
assert( ep != NULL );
|
||||||
|
|
||||||
snprintf( buf, sizeof( buf ),
|
snprintf( buf, sizeof( buf ),
|
||||||
"dn: cn=Connection %ld,%s\n"
|
"dn: cn=" CONN_CN_PREFIX " %ld,%s\n"
|
||||||
SLAPD_MONITOR_OBJECTCLASSES
|
SLAPD_MONITOR_OBJECTCLASSES
|
||||||
"cn: Connection %ld\n",
|
"cn: " CONN_CN_PREFIX " %ld\n",
|
||||||
c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val,
|
c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val,
|
||||||
c->c_connid );
|
c->c_connid );
|
||||||
e = str2entry( buf );
|
e = str2entry( buf );
|
||||||
@ -269,14 +271,14 @@ conn_create(
|
|||||||
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
|
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
|
||||||
"monitor_subsys_conn_create: "
|
"monitor_subsys_conn_create: "
|
||||||
"unable to create entry "
|
"unable to create entry "
|
||||||
"'cn=Connection %ld,%s' entry\n",
|
"'cn=" CONN_CN_PREFIX " %ld,%s' entry\n",
|
||||||
c->c_connid,
|
c->c_connid,
|
||||||
monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val ));
|
monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val ));
|
||||||
#else
|
#else
|
||||||
Debug( LDAP_DEBUG_ANY,
|
Debug( LDAP_DEBUG_ANY,
|
||||||
"monitor_subsys_conn_create: "
|
"monitor_subsys_conn_create: "
|
||||||
"unable to create entry "
|
"unable to create entry "
|
||||||
"'cn=Connection %ld,%s' entry\n",
|
"'cn=" CONN_CN_PREFIX " %ld,%s' entry\n",
|
||||||
c->c_connid,
|
c->c_connid,
|
||||||
monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
|
monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
|
||||||
#endif
|
#endif
|
||||||
@ -405,7 +407,8 @@ monitor_subsys_conn_create(
|
|||||||
assert( values );
|
assert( values );
|
||||||
assert( values[ 0 ][ 0 ] );
|
assert( values[ 0 ][ 0 ] );
|
||||||
|
|
||||||
connid = atol( values[ 0 ][ 0 ]->la_value.bv_val );
|
connid = atol( values[ 0 ][ 0 ]->la_value.bv_val
|
||||||
|
+ sizeof( CONN_CN_PREFIX ) );
|
||||||
|
|
||||||
ldap_rdnfree( values );
|
ldap_rdnfree( values );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user