LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#if LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_abandon LDAP_P(( /* deprecated */
+ldap_abandon LDAP_P(( /* deprecated, use ldap_abandon_ext */
LDAP *ld,
int msgid ));
#endif
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_add LDAP_P(( /* deprecated */
+ldap_add LDAP_P(( /* deprecated, use ldap_add_ext */
LDAP *ld,
LDAP_CONST char *dn,
LDAPMod **attrs ));
LDAP_F( int )
-ldap_add_s LDAP_P(( /* deprecated */
+ldap_add_s LDAP_P(( /* deprecated, use ldap_add_ext_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAPMod **attrs ));
* (deprecated)
*/
LDAP_F( int )
-ldap_bind LDAP_P(( /* deprecated */
+ldap_bind LDAP_P(( /* deprecated, use ldap_sasl_bind */
LDAP *ld,
LDAP_CONST char *who,
LDAP_CONST char *passwd,
int authmethod ));
LDAP_F( int )
-ldap_bind_s LDAP_P(( /* deprecated */
+ldap_bind_s LDAP_P(( /* deprecated, use ldap_sasl_bind_s */
LDAP *ld,
LDAP_CONST char *who,
LDAP_CONST char *cred,
* in sbind.c:
*/
LDAP_F( int )
-ldap_simple_bind LDAP_P(( /* deprecated */
+ldap_simple_bind LDAP_P(( /* deprecated, use ldap_sasl_bind */
LDAP *ld,
LDAP_CONST char *who,
LDAP_CONST char *passwd ));
LDAP_F( int )
-ldap_simple_bind_s LDAP_P(( /* deprecated */
+ldap_simple_bind_s LDAP_P(( /* deprecated, use ldap_sasl_bind_s */
LDAP *ld,
LDAP_CONST char *who,
LDAP_CONST char *passwd ));
/*
* in kbind.c:
- * (deprecated)
+ * (deprecated - use SASL instead)
*/
LDAP_F( int )
ldap_kerberos_bind_s LDAP_P(( /* deprecated */
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_compare LDAP_P(( /* deprecated */
+ldap_compare LDAP_P(( /* deprecated, use ldap_compare_ext */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *attr,
LDAP_CONST char *value ));
LDAP_F( int )
-ldap_compare_s LDAP_P(( /* deprecated */
+ldap_compare_s LDAP_P(( /* deprecated, use ldap_compare_ext_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *attr,
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_delete LDAP_P(( /* deprecated */
+ldap_delete LDAP_P(( /* deprecated, use ldap_delete_ext */
LDAP *ld,
LDAP_CONST char *dn ));
LDAP_F( int )
-ldap_delete_s LDAP_P(( /* deprecated */
+ldap_delete_s LDAP_P(( /* deprecated, use ldap_delete_ext_s */
LDAP *ld,
LDAP_CONST char *dn ));
#endif
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_result2error LDAP_P(( /* deprecated */
+ldap_result2error LDAP_P(( /* deprecated, use ldap_parse_result */
LDAP *ld,
LDAPMessage *r,
int freeit ));
LDAP_F( void )
-ldap_perror LDAP_P(( /* deprecated */
+ldap_perror LDAP_P(( /* deprecated, use ldap_err2string */
LDAP *ld,
LDAP_CONST char *s ));
#endif
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_modify LDAP_P(( /* deprecated */
+ldap_modify LDAP_P(( /* deprecated, use ldap_modify_ext */
LDAP *ld,
LDAP_CONST char *dn,
LDAPMod **mods ));
LDAP_F( int )
-ldap_modify_s LDAP_P(( /* deprecated */
+ldap_modify_s LDAP_P(( /* deprecated, use ldap_modify_ext_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAPMod **mods ));
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_rename2 LDAP_P(( /* deprecated */
+ldap_rename2 LDAP_P(( /* deprecated, use ldap_rename */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn,
int deleteoldrdn ));
LDAP_F( int )
-ldap_rename2_s LDAP_P(( /* deprecated */
+ldap_rename2_s LDAP_P(( /* deprecated, use ldap_rename_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn,
int deleteoldrdn ));
LDAP_F( int )
-ldap_modrdn LDAP_P(( /* deprecated */
+ldap_modrdn LDAP_P(( /* deprecated, use ldap_rename */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn ));
LDAP_F( int )
-ldap_modrdn_s LDAP_P(( /* deprecated */
+ldap_modrdn_s LDAP_P(( /* deprecated, use ldap_rename_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn ));
LDAP_F( int )
-ldap_modrdn2 LDAP_P(( /* deprecated */
+ldap_modrdn2 LDAP_P(( /* deprecated, use ldap_rename */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn,
int deleteoldrdn ));
LDAP_F( int )
-ldap_modrdn2_s LDAP_P(( /* deprecated */
+ldap_modrdn2_s LDAP_P(( /* deprecated, use ldap_rename_s */
LDAP *ld,
LDAP_CONST char *dn,
LDAP_CONST char *newrdn,
*/
#if LDAP_DEPRECATED
LDAP_F( LDAP * )
-ldap_init LDAP_P(( /* deprecated */
+ldap_init LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */
LDAP_CONST char *host,
int port ));
LDAP_F( LDAP * )
-ldap_open LDAP_P(( /* deprecated */
+ldap_open LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */
LDAP_CONST char *host,
int port ));
#endif
char **out, unsigned oflags ));
LDAP_F( char * )
-ldap_dn2ufn LDAP_P(( /* deprecated */
+ldap_dn2ufn LDAP_P(( /* deprecated, use ldap_str2dn/dn2str */
LDAP_CONST char *dn ));
LDAP_F( char ** )
-ldap_explode_dn LDAP_P(( /* deprecated */
+ldap_explode_dn LDAP_P(( /* deprecated, ldap_str2dn */
LDAP_CONST char *dn,
int notypes ));
LDAP_F( char ** )
-ldap_explode_rdn LDAP_P(( /* deprecated */
+ldap_explode_rdn LDAP_P(( /* deprecated, ldap_str2rdn */
LDAP_CONST char *rdn,
int notypes ));
LDAPDN_rewrite_func *func, unsigned flags ));
LDAP_F( char * )
-ldap_dn2dcedn LDAP_P(( LDAP_CONST char *dn )); /* deprecated */
+ldap_dn2dcedn LDAP_P(( /* deprecated, ldap_str2dn/dn2str */
+ LDAP_CONST char *dn ));
LDAP_F( char * )
-ldap_dcedn2dn LDAP_P(( LDAP_CONST char *dce )); /* deprecated */
+ldap_dcedn2dn LDAP_P(( /* deprecated, ldap_str2dn/dn2str */
+ LDAP_CONST char *dce ));
LDAP_F( char * )
-ldap_dn2ad_canonical LDAP_P(( LDAP_CONST char *dn )); /* deprecated */
+ldap_dn2ad_canonical LDAP_P(( /* deprecated, ldap_str2dn/dn2str */
+ LDAP_CONST char *dn ));
LDAP_F( int )
ldap_get_dn_ber LDAP_P((
#if LDAP_DEPRECATED
LDAP_F( char ** )
-ldap_get_values LDAP_P(( /* deprecated */
+ldap_get_values LDAP_P(( /* deprecated, use ldap_get_values_len */
LDAP *ld,
LDAPMessage *entry,
LDAP_CONST char *target ));
LDAP_F( int )
-ldap_count_values LDAP_P(( /* deprecated */
+ldap_count_values LDAP_P(( /* deprecated, use ldap_count_values_len */
char **vals ));
LDAP_F( void )
-ldap_value_free LDAP_P(( /* deprecated */
+ldap_value_free LDAP_P(( /* deprecated, use ldap_values_free_len */
char **vals ));
#endif
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_search LDAP_P(( /* deprecated */
+ldap_search LDAP_P(( /* deprecated, use ldap_search_ext */
LDAP *ld,
LDAP_CONST char *base,
int scope,
int attrsonly ));
LDAP_F( int )
-ldap_search_s LDAP_P(( /* deprecated */
+ldap_search_s LDAP_P(( /* deprecated, use ldap_search_ext_s */
LDAP *ld,
LDAP_CONST char *base,
int scope,
LDAPMessage **res ));
LDAP_F( int )
-ldap_search_st LDAP_P(( /* deprecated */
+ldap_search_st LDAP_P(( /* deprecated, use ldap_search_ext_s */
LDAP *ld,
LDAP_CONST char *base,
int scope,
#if LDAP_DEPRECATED
LDAP_F( int )
-ldap_unbind LDAP_P(( /* deprecated */
+ldap_unbind LDAP_P(( /* deprecated, use ldap_unbind_ext */
LDAP *ld ));
LDAP_F( int )
-ldap_unbind_s LDAP_P(( /* deprecated */
+ldap_unbind_s LDAP_P(( /* deprecated, use ldap_unbind_ext_s */
LDAP *ld ));
#endif
#if LDAP_DEPRECATED
/*
- * in sort.c (deprecated)
+ * in sort.c (deprecated, use custom code instead)
*/
typedef int (LDAP_SORT_AD_CMP_PROC) LDAP_P(( /* deprecated */
LDAP_CONST char *left,
return NULL;
}
+/* Start the task to play back queued psearch responses */
+static void
+syncprov_qstart( syncops *so )
+{
+ int wake=0;
+ ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+ if ( !so->s_qtask ) {
+ so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
+ syncprov_qtask, so, "syncprov_qtask",
+ so->s_op->o_conn->c_peer_name.bv_val );
+ ++so->s_inuse;
+ wake = 1;
+ } else {
+ if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) &&
+ !so->s_qtask->next_sched.tv_sec ) {
+ so->s_qtask->interval.tv_sec = 0;
+ ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 );
+ so->s_qtask->interval.tv_sec = RUNQ_INTERVAL;
+ ++so->s_inuse;
+ wake = 1;
+ }
+ }
+ ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+ if ( wake )
+ slap_wake_listener();
+}
+
/* Queue a persistent search response */
static int
syncprov_qresp( opcookie *opc, syncops *so, int mode )
so->s_flags |= PS_FIND_BASE;
}
if ( so->s_flags & PS_IS_DETACHED ) {
- int wake=0;
- ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
- if ( !so->s_qtask ) {
- so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
- syncprov_qtask, so, "syncprov_qtask",
- so->s_op->o_conn->c_peer_name.bv_val );
- ++so->s_inuse;
- wake = 1;
- } else {
- if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) &&
- !so->s_qtask->next_sched.tv_sec ) {
- so->s_qtask->interval.tv_sec = 0;
- ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 );
- so->s_qtask->interval.tv_sec = RUNQ_INTERVAL;
- ++so->s_inuse;
- wake = 1;
- }
- }
- ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
- if ( wake )
- slap_wake_listener();
+ syncprov_qstart( so );
}
ldap_pvt_thread_mutex_unlock( &so->s_mutex );
return LDAP_SUCCESS;
/* Update our context CSN */
cbuf[0] = '\0';
ldap_pvt_thread_mutex_lock( &si->si_csn_mutex );
- slap_get_commit_csn( op, &maxcsn, NULL );
+ slap_get_commit_csn( op, &maxcsn );
if ( !BER_BVISNULL( &maxcsn ) ) {
strcpy( cbuf, maxcsn.bv_val );
if ( ber_bvcmp( &maxcsn, &si->si_ctxcsn ) > 0 ) {
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
} else {
/* It's RefreshAndPersist, transition to Persist phase */
- syncprov_sendinfo( op, rs, ( ss->ss_present && rs->sr_nentries ) ?
+ syncprov_sendinfo( op, rs, ss->ss_present ?
LDAP_TAG_SYNC_REFRESH_PRESENT : LDAP_TAG_SYNC_REFRESH_DELETE,
&cookie, 1, NULL, 0 );
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
ss->ss_so->s_flags ^= PS_IS_REFRESHING;
syncprov_detach_op( op, ss->ss_so, on );
+
+ /* If there are queued responses, fire them off */
+ if ( ss->ss_so->s_res )
+ syncprov_qstart( ss->ss_so );
ldap_pvt_thread_mutex_unlock( &ss->ss_so->s_mutex );
return LDAP_SUCCESS;
sl=si->si_logs;
if ( sl ) {
ldap_pvt_thread_mutex_lock( &sl->sl_mutex );
- if ( ber_bvcmp( &srs->sr_state.ctxcsn, &sl->sl_mincsn ) >= 0 ) {
+ /* Are there any log entries, and is the consumer state
+ * present in the session log?
+ */
+ if ( sl->sl_num > 0 && ber_bvcmp( &srs->sr_state.ctxcsn, &sl->sl_mincsn ) >= 0 ) {
do_present = 0;
/* mutex is unlocked in playlog */
syncprov_playlog( op, rs, sl, srs, &ctxcsn );