From: Pierangelo Masarati Date: Mon, 9 Apr 2012 16:36:14 +0000 (+0200) Subject: move entrypriv_create into monitor_extra_t X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=829efa878a79eca67d21b8784cd33662de1871bb;p=openldap move entrypriv_create into monitor_extra_t --- diff --git a/servers/slapd/back-ldap/monitor.c b/servers/slapd/back-ldap/monitor.c index 678feae5ca..456c14a418 100644 --- a/servers/slapd/back-ldap/monitor.c +++ b/servers/slapd/back-ldap/monitor.c @@ -377,6 +377,7 @@ ldap_back_monitor_subsystem_destroy( */ struct ldap_back_monitor_conn_arg { + Operation *op; monitor_subsys_t *ms; Entry **ep; }; @@ -467,6 +468,7 @@ ldap_back_monitor_conn_entry( { Entry *e; monitor_entry_t *mp; + monitor_extra_t *mbe; char buf[SLAP_TEXT_BUFLEN]; char *ptr; struct berval bv, dn, ndn; @@ -511,7 +513,8 @@ ldap_back_monitor_conn_entry( attr_merge_normalize_one( e, ad_olmDbPeerAddress, &bv, NULL ); ch_free( bv.bv_val ); - mp = monitor_entrypriv_create(); + mbe = (monitor_extra_t *) arg->op->o_bd->bd_info->bi_extra; + mp = mbe->entrypriv_create(); e->e_private = mp; mp->mp_info = arg->ms; mp->mp_flags = MONITOR_F_SUB | MONITOR_F_VOLATILE; @@ -545,6 +548,7 @@ ldap_back_monitor_conn_create( li = (ldapinfo_t *)ms->mss_private; arg = ch_calloc( 1, sizeof(struct ldap_back_monitor_conn_arg) ); + arg->op = op; arg->ep = ep; arg->ms = ms; diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index cf33b7c086..7a5674c618 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -313,6 +313,7 @@ typedef struct monitor_extra_t { monitor_info_t *mi, struct berval *create, struct berval *modify ); + monitor_entry_t * (*entrypriv_create)( void ); } monitor_extra_t; LDAP_END_DECL diff --git a/servers/slapd/back-monitor/entry.c b/servers/slapd/back-monitor/entry.c index f1fe273883..068bfc5838 100644 --- a/servers/slapd/back-monitor/entry.c +++ b/servers/slapd/back-monitor/entry.c @@ -151,7 +151,7 @@ monitor_entry_test_flags( } monitor_entry_t * -monitor_entrypriv_create( void ) +monitor_back_entrypriv_create( void ) { monitor_entry_t *mp; diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 894ba4a715..458f0bc439 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -66,7 +66,8 @@ static const monitor_extra_t monitor_extra = { monitor_back_unregister_entry_attrs, monitor_back_unregister_entry_callback, - monitor_back_entry_stub + monitor_back_entry_stub, + monitor_back_entrypriv_create }; diff --git a/servers/slapd/back-monitor/proto-back-monitor.h b/servers/slapd/back-monitor/proto-back-monitor.h index cf0eba21b7..143d917eb9 100644 --- a/servers/slapd/back-monitor/proto-back-monitor.h +++ b/servers/slapd/back-monitor/proto-back-monitor.h @@ -124,9 +124,8 @@ monitor_entry_test_flags LDAP_P(( monitor_entry_t *mp, int cond )); extern monitor_entry_t * -monitor_entrypriv_create LDAP_P(( +monitor_back_entrypriv_create LDAP_P(( void )); - extern Entry * monitor_back_entry_stub LDAP_P(( struct berval *pdn, @@ -137,6 +136,7 @@ monitor_back_entry_stub LDAP_P(( struct berval *create, struct berval *modify )); +#define monitor_entrypriv_create monitor_back_entrypriv_create #define monitor_entry_stub monitor_back_entry_stub /*