#if 0
bdb_build_sync_done_ctrl( conn, ps_list, ps_list->ctrls, 1, &latest_entrycsn_bv );
- send_search_result( conn, ps_list, LDAP_CANCELLED,
+ send_ldap_result( conn, ps_list, LDAP_CANCELLED,
NULL, NULL, NULL, ps_list->ctrls, ps_list->nentries);
#endif
rs->sr_err = LDAP_CANCELLED;
- rs->sr_nentries = 0;
- send_search_result( ps_list, rs );
+ send_ldap_result( ps_list, rs );
slap_op_free ( ps_list );
return LDAP_SUCCESS;
Entry *matched = NULL;
struct berval realbase = { 0, NULL };
int manageDSAit;
- int nentries = 0, tentries = 0;
+ int tentries = 0;
ID lastid = NOID;
AttributeName *attrs;
/* positive hard limit means abort */
} else if ( limit->lms_t_hard > 0 ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
rs->sr_err = 0;
goto done;
}
/* positive hard limit means abort */
} else if ( limit->lms_s_hard > 0 ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
rs->sr_err = 0;
goto done;
}
#endif
rs->sr_err = LDAP_SUCCESS;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
rs->sr_err = 1;
goto done;
}
if ( !isroot && limit->lms_s_unchecked != -1 ) {
if ( BDB_IDL_N(candidates) > (unsigned) limit->lms_s_unchecked ) {
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
rs->sr_err = 1;
goto done;
}
if ( sop->o_pagedresults_size == 0 ) {
rs->sr_err = LDAP_SUCCESS;
rs->sr_text = "search abandoned by pagedResult size=0";
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
goto done;
}
for ( id = bdb_idl_first( candidates, &cursor );
"bdb_search: no paged results candidates\n",
0, 0, 0 );
#endif
- rs->sr_nentries = nentries;
send_pagerequest_response( sop, rs, lastid, 0 );
rs->sr_err = 1;
if ( sop->o_cancel ) {
assert( sop->o_cancel == SLAP_CANCEL_REQ );
rs->sr_err = LDAP_CANCELLED;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
sop->o_cancel = SLAP_CANCEL_ACK;
rs->sr_err = 0;
goto done;
if ( sop->oq_search.rs_tlimit != -1 && slap_get_time() > stoptime ) {
rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
rs->sr_ref = rs->sr_v2ref;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
goto done;
}
rs->sr_entry = NULL;
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
rs->sr_ref = rs->sr_v2ref;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
goto done;
}
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( get_pagedresults(sop) ) {
- if ( nentries >= sop->o_pagedresults_size ) {
- rs->sr_nentries = nentries;
+ if ( rs->sr_nentries >= sop->o_pagedresults_size ) {
send_pagerequest_response( sop, rs,
lastid, tentries );
goto done;
switch (result) {
case 0: /* entry sent ok */
- nentries++;
break;
case 1: /* entry not sent */
break;
rs->sr_ctrls = ctrls;
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
ch_free( latest_entrycsn_bv.bv_val );
latest_entrycsn_bv.bv_val = NULL;
rs->sr_ctrls = ctrls;
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
if ( ctrls[num_ctrls-1]->ldctl_value.bv_val != NULL )
ch_free( ctrls[num_ctrls-1]->ldctl_value.bv_val );
ch_free( ctrls[--num_ctrls] );
rs->sr_ctrls = NULL;
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
- rs->sr_nentries = nentries;
- send_search_result( sop, rs );
+ send_ldap_result( sop, rs );
}
}
rs->sr_ctrls = ctrls;
rs->sr_err = LDAP_SUCCESS;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
done:
(void) ber_free_buf( ber );
* but this is necessary for version matching, and for ACL processing.
*/
- for ( rs->sr_nentries=0, rc=0;
- rc != -1;
- rc = ldap_result(lc->ld, msgid, 0, &tv, &res))
+ for ( rc=0; rc != -1; rc = ldap_result(lc->ld, msgid, 0, &tv, &res))
{
/* check for abandon */
if (op->o_abandon) {
e = ldap_first_entry(lc->ld,res);
if ( ldap_build_entry(op->o_bd, op->o_conn, e, &ent, &bdn, 1) == LDAP_SUCCESS ) {
Attribute *a;
- rs->sr_nentries++;
rs->sr_entry = &ent;
rs->sr_attrs = op->oq_search.rs_attrs;
send_search_entry( op, rs );
if ( rs->sr_v2ref ) {
rs->sr_err = LDAP_REFERRAL;
}
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
finish:;
if ( match ) {
struct berval realbase = { 0, NULL };
int manageDSAit = get_manageDSAit( op );
int cscope = LDAP_SCOPE_DEFAULT;
- int nentries = 0;
#ifdef LDAP_CACHING
Entry cache_base_entry;
#endif /* LDAP_CACHING */
rs->sr_err = LDAP_SUCCESS;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
#ifdef LDAP_CACHING
if ( op->o_caching_on ) {
/* check time limit */
if ( op->oq_search.rs_tlimit != -1 && slap_get_time() > stoptime ) {
rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
- rs->sr_nentries = nentries;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
rc = 0;
goto done;
}
if ( --op->oq_search.rs_slimit == -1 ) {
cache_return_entry_r( &li->li_cache, e );
rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
- rs->sr_nentries = nentries;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
rc = 0;
goto done;
}
switch (result) {
case 0: /* entry sent ok */
- nentries++;
break;
case 1: /* entry not sent */
break;
rs->sr_err = rs->sr_v2ref ? LDAP_REFERRAL : LDAP_SUCCESS;
rs->sr_ref = rs->sr_v2ref;
- rs->sr_nentries = nentries;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
rc = 0;
if ( e == NULL ) {
rs->sr_err = LDAP_NO_SUCH_OBJECT;
if ( matched ) {
- rs->sr_matched = ch_strdup( matched->e_dn );
+ rs->sr_matched = matched->e_name.bv_val;
}
send_ldap_result( op, rs );
if ( matched != NULL ) {
Operation *op,
SlapReply *rs,
Entry *e_parent,
- int sub,
- int *nentriesp
+ int sub
)
{
struct monitorinfo *mi =
(struct monitorinfo *) op->o_bd->be_private;
Entry *e, *e_tmp, *e_ch;
struct monitorentrypriv *mp;
- int nentries;
int rc;
mp = ( struct monitorentrypriv * )e_parent->e_private;
}
/* return entries */
- for ( nentries = *nentriesp; e != NULL; ) {
+ for ( ; e != NULL; ) {
mp = ( struct monitorentrypriv * )e->e_private;
monitor_entry_update( mi, e );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
send_search_entry( op, rs );
- nentries++;
}
if ( ( mp->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
&& sub ) {
- rc = monitor_send_children( op, rs, e, sub, &nentries );
+ rc = monitor_send_children( op, rs, e, sub );
if ( rc ) {
return( rc );
}
= (struct monitorinfo *) op->o_bd->be_private;
int rc = LDAP_SUCCESS;
Entry *e, *matched = NULL;
- int nentries = 0;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_MON, ENTRY,
return( 0 );
}
- nentries = 0;
switch ( op->oq_search.rs_scope ) {
case LDAP_SCOPE_BASE:
monitor_entry_update( mi, e );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
send_search_entry( op, rs );
- nentries = 1;
}
rc = LDAP_SUCCESS;
monitor_cache_release( mi, e );
break;
case LDAP_SCOPE_ONELEVEL:
- rc = monitor_send_children( op, rs, e, 0, &nentries );
+ rc = monitor_send_children( op, rs, e, 0 );
if ( rc ) {
rc = LDAP_OTHER;
}
rc = test_filter( op, e, op->oq_search.rs_filter );
if ( rc == LDAP_COMPARE_TRUE ) {
send_search_entry( op, rs );
- nentries++;
}
- rc = monitor_send_children( op, rs, e, 1, &nentries );
+ rc = monitor_send_children( op, rs, e, 1 );
if ( rc ) {
rc = LDAP_OTHER;
}
break;
}
- rs->sr_nentries = nentries;
rs->sr_err = rc;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
return( rc == LDAP_SUCCESS ? 0 : 1 );
}
char *s;
time_t stoptime;
- int sent = 0;
-
LDAPRDN *rdn = NULL;
struct berval parent = { 0, NULL };
rs->sr_entry = e;
rs->sr_attrs = op->oq_search.rs_attrs;
send_search_entry( op, rs );
- sent++;
}
}
rs->sr_entry = e;
rs->sr_attrs = op->oq_search.rs_attrs;
send_search_entry( op, rs );
- sent++;
}
entry_free( e );
rs->sr_entry = e;
rs->sr_attrs = op->oq_search.rs_attrs;
send_search_entry( op, rs );
- sent++;
}
entry_free( e );
done:
if( rs->sr_err != LDAP_NO_SUCH_OBJECT ) rs->sr_matched = NULL;
- rs->sr_nentries = sent;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
if( rdn != NULL ) ldap_rdnfree( rdn );
static BackendDB *glueBack;
static slap_response glue_back_response;
-static slap_sresult glue_back_sresult;
-static slap_sendentry glue_back_sendentry;
-static slap_sendreference glue_back_sendreference;
/* Just like select_backend, but only for our backends */
static BackendDB *
typedef struct glue_state {
int err;
- int nentries;
int matchlen;
char *matched;
int nrefs;
slap_callback *prevcb;
} glue_state;
-static void
+static int
glue_back_response ( Operation *op, SlapReply *rs )
{
glue_state *gs = op->o_callback->sc_private;
+ slap_callback *tmp = op->o_callback;
- if (rs->sr_err == LDAP_SUCCESS || gs->err != LDAP_SUCCESS)
- gs->err = rs->sr_err;
- if (gs->err == LDAP_SUCCESS && gs->matched) {
- ch_free (gs->matched);
- gs->matched = NULL;
- gs->matchlen = 0;
- }
- if (gs->err != LDAP_SUCCESS && rs->sr_matched) {
- int len;
- len = strlen (rs->sr_matched);
- if (len > gs->matchlen) {
- if (gs->matched)
- ch_free (gs->matched);
- gs->matched = ch_strdup (rs->sr_matched);
- gs->matchlen = len;
+ switch(rs->sr_type) {
+ case REP_SEARCH:
+ case REP_SEARCHREF:
+ op->o_callback = gs->prevcb;
+ if (op->o_callback && op->o_callback->sc_response) {
+ rs->sr_err = op->o_callback->sc_response( op, rs );
+ } else if (rs->sr_type == REP_SEARCH) {
+ rs->sr_err = send_search_entry( op, rs );
+ } else {
+ rs->sr_err = send_search_reference( op, rs );
}
- }
- if (rs->sr_ref) {
- int i, j, k;
- BerVarray new;
-
- for (i=0; rs->sr_ref[i].bv_val; i++);
+ op->o_callback = tmp;
+ return rs->sr_err;
- j = gs->nrefs;
- if (!j) {
- new = ch_malloc ((i+1)*sizeof(struct berval));
- } else {
- new = ch_realloc(gs->refs,
- (j+i+1)*sizeof(struct berval));
+ default:
+ if (rs->sr_err == LDAP_SUCCESS || gs->err != LDAP_SUCCESS)
+ gs->err = rs->sr_err;
+ if (gs->err == LDAP_SUCCESS && gs->matched) {
+ ch_free (gs->matched);
+ gs->matched = NULL;
+ gs->matchlen = 0;
}
- for (k=0; k<i; j++,k++) {
- ber_dupbv( &new[j], &rs->sr_ref[k] );
+ if (gs->err != LDAP_SUCCESS && rs->sr_matched) {
+ int len;
+ len = strlen (rs->sr_matched);
+ if (len > gs->matchlen) {
+ if (gs->matched)
+ ch_free (gs->matched);
+ gs->matched = ch_strdup (rs->sr_matched);
+ gs->matchlen = len;
+ }
}
- new[j].bv_val = NULL;
- gs->nrefs = j;
- gs->refs = new;
- }
-}
-
-static void
-glue_back_sresult ( Operation *op, SlapReply *rs )
-{
- glue_state *gs = op->o_callback->sc_private;
-
- gs->nentries += rs->sr_nentries;
- glue_back_response( op, rs );
-}
+ if (rs->sr_ref) {
+ int i, j, k;
+ BerVarray new;
-static int
-glue_back_sendentry ( Operation *op, SlapReply *rs )
-{
- slap_callback *tmp = op->o_callback;
- glue_state *gs = tmp->sc_private;
-
- op->o_callback = gs->prevcb;
- if (op->o_callback && op->o_callback->sc_sendentry) {
- rs->sr_err = op->o_callback->sc_sendentry(op, rs);
- } else {
- rs->sr_err = send_search_entry(op, rs);
- }
- op->o_callback = tmp;
- return rs->sr_err;
-}
-
-static int
-glue_back_sendreference ( Operation *op, SlapReply *rs )
-{
- slap_callback *tmp = op->o_callback;
- glue_state *gs = tmp->sc_private;
+ for (i=0; rs->sr_ref[i].bv_val; i++);
- op->o_callback = gs->prevcb;
- if (op->o_callback && op->o_callback->sc_sendreference) {
- rs->sr_err = op->o_callback->sc_sendreference( op, rs );
- } else {
- rs->sr_err = send_search_reference( op, rs );
+ j = gs->nrefs;
+ if (!j) {
+ new = ch_malloc ((i+1)*sizeof(struct berval));
+ } else {
+ new = ch_realloc(gs->refs,
+ (j+i+1)*sizeof(struct berval));
+ }
+ for (k=0; k<i; j++,k++) {
+ ber_dupbv( &new[j], &rs->sr_ref[k] );
+ }
+ new[j].bv_val = NULL;
+ gs->nrefs = j;
+ gs->refs = new;
+ }
}
- op->o_callback = tmp;
- return rs->sr_err;
}
static int
glueinfo *gi = (glueinfo *) b0->bd_info;
int i;
long stoptime = 0;
- glue_state gs = {0, 0, 0, NULL, 0, NULL, NULL};
- slap_callback cb;
+ glue_state gs = {0, 0, NULL, 0, NULL, NULL};
+ slap_callback cb = { glue_back_response };
int scope0, slimit0, tlimit0;
struct berval dn, ndn;
- cb.sc_response = glue_back_response;
- cb.sc_sresult = glue_back_sresult;
- cb.sc_sendentry = glue_back_sendentry;
- cb.sc_sendreference = glue_back_sendreference;
cb.sc_private = &gs;
gs.prevcb = op->o_callback;
}
}
if (slimit0) {
- op->ors_slimit = slimit0 - gs.nentries;
+ op->ors_slimit = slimit0 - rs->sr_nentries;
if (op->ors_slimit <= 0) {
rs->sr_err = gs.err = LDAP_SIZELIMIT_EXCEEDED;
break;
rs->sr_err = gs.err;
rs->sr_matched = gs.matched;
rs->sr_ref = gs.refs;
- rs->sr_nentries = gs.nentries;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
done:
op->o_bd = b0;
if( c->c_struct_state == SLAP_C_UNINITIALIZED ) {
c->c_send_ldap_result = slap_send_ldap_result;
c->c_send_search_entry = slap_send_search_entry;
- c->c_send_search_result = slap_send_search_result;
c->c_send_search_reference = slap_send_search_reference;
c->c_send_ldap_extended = slap_send_ldap_extended;
#ifdef LDAP_RES_INTERMEDIATE_RESP
LDAP_SLAPD_F (int) slap_sasl_regexp_config LDAP_P((
const char *match, const char *replace ));
LDAP_SLAPD_F (int) slap_sasl_setpolicy LDAP_P(( const char * ));
-LDAP_SLAPD_F (slap_response) slap_cb_null_response;
-LDAP_SLAPD_F (slap_sresult) slap_cb_null_sresult;
-LDAP_SLAPD_F (slap_sendreference) slap_cb_null_sreference;
/*
send_ldap_response( op, rs );
- if ( rs->sr_type == REP_SRESULT ) {
+ if ( op->o_tag == LDAP_REQ_SEARCH ) {
char nbuf[64];
snprintf( nbuf, sizeof nbuf, "%d nentries=%d", rs->sr_err, rs->sr_nentries );
}
#endif
-void
-slap_send_search_result( Operation *op, SlapReply *rs )
-{
- rs->sr_type = REP_SRESULT;
- slap_send_ldap_result( op, rs );
-}
-
int
slap_send_search_entry( Operation *op, SlapReply *rs )
{
char **e_flags = NULL;
rs->sr_type = REP_SEARCH;
- if (op->o_callback && op->o_callback->sc_sendentry) {
- return op->o_callback->sc_sendentry( op, rs );
+ if (op->o_callback && op->o_callback->sc_response) {
+ return op->o_callback->sc_response( op, rs );
}
#ifdef NEW_LOGGING
return -1;
}
+ rs->sr_nentries++;
ldap_pvt_thread_mutex_lock( &num_sent_mutex );
num_bytes_sent += bytes;
AttributeDescription *ad_entry = slap_schema.si_ad_entry;
rs->sr_type = REP_SEARCHREF;
- if (op->o_callback && op->o_callback->sc_sendreference) {
- return op->o_callback->sc_sendreference( op, rs );
+ if (op->o_callback && op->o_callback->sc_response) {
+ return op->o_callback->sc_response( op, rs );
}
#ifdef NEW_LOGGING
sasl_server_params_t *sparams;
} lookup_info;
-static slap_sendentry sasl_ap_lookup, sasl_cb_checkpass;
+static slap_response sasl_ap_lookup, sasl_cb_checkpass;
static int
sasl_ap_lookup( Operation *op, SlapReply *rs )
slap_callback *tmp = op->o_callback;
lookup_info *sl = tmp->sc_private;
+ if (rs->sr_type != REP_SEARCH) return 0;
+
for( i = 0; i < sl->last; i++ ) {
const char *name = sl->list[i].name;
}
if (doit) {
- slap_callback cb = { slap_cb_null_response,
- slap_cb_null_sresult, sasl_ap_lookup, slap_cb_null_sreference, NULL };
+ slap_callback cb = { sasl_ap_lookup };
cb.sc_private = &sl;
Attribute *a;
struct berval *bv;
+ if (rs->sr_type != REP_SEARCH) return 0;
+
ci->rc = SASL_NOVERIFY;
a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_userPassword );
op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
if ( op.o_bd && op.o_bd->be_search ) {
- slap_callback cb = { slap_cb_null_response,
- slap_cb_null_sresult, sasl_cb_checkpass, slap_cb_null_sreference, NULL };
+ slap_callback cb = { sasl_cb_checkpass };
SlapReply rs = {REP_RESULT};
ci.cred.bv_val = (char *)pass;
return( 1 );
}
-/* Two empty callback functions to avoid sending results */
-void slap_cb_null_response( Operation *o, SlapReply *rs )
-{
-}
-
-void slap_cb_null_sresult( Operation *o, SlapReply *rs )
-{
-}
-
-int slap_cb_null_sreference( Operation *o, SlapReply *rs )
-{
- return 0;
-}
-
/* This callback actually does some work...*/
static int sasl_sc_sasl2dn( Operation *o, SlapReply *rs )
{
struct berval *ndn = o->o_callback->sc_private;
+ if (rs->sr_type != REP_SEARCH) return 0;
+
/* We only want to be called once */
if( ndn->bv_val ) {
free(ndn->bv_val);
{
smatch_info *sm = o->o_callback->sc_private;
+ if (rs->sr_type != REP_SEARCH) return 0;
+
if (dn_match(sm->dn, &rs->sr_entry->e_nname)) {
sm->match = 1;
return -1; /* short-circuit the search */
int rc;
regex_t reg;
smatch_info sm;
- slap_callback cb = {
- slap_cb_null_response,
- slap_cb_null_sresult,
- sasl_sc_smatch,
- slap_cb_null_sreference
- };
+ slap_callback cb = { sasl_sc_smatch };
Operation op = {0};
SlapReply rs = {REP_RESULT};
struct berval *saslname, struct berval *sasldn )
{
int rc;
- slap_callback cb = { slap_cb_null_response,
- slap_cb_null_sresult, sasl_sc_sasl2dn, slap_cb_null_sreference, NULL};
+ slap_callback cb = { sasl_sc_sasl2dn };
Operation op = {0};
SlapReply rs = {REP_RESULT};
struct berval regout = { 0, NULL };
entry_free( entry );
rs->sr_err = LDAP_SUCCESS;
- rs->sr_nentries = 1;
- send_search_result( op, rs );
+ send_ldap_result( op, rs );
#ifdef LDAP_SLAPI
doPostSearchPluginFNs( op );
#endif /* LDAP_SLAPI */
#define SLAP_NVALUES 1
/* #define SLAP_NVALUES_ON_DISK 1 */
#define SLAP_EXTENDED_SCHEMA 1
+#define LDAP_CACHING
#endif
LDAP_BEGIN_DECL
typedef enum slap_reply_e {
REP_RESULT,
REP_SASL,
- REP_SRESULT,
REP_EXTENDED,
REP_SEARCH,
REP_SEARCHREF
struct berval *r_sasldata;
} rep_sasl_s;
-typedef struct rep_sresult_s {
- int r_nentries;
-} rep_sresult_s;
-
typedef struct rep_extended_s {
const char *r_rspoid;
struct berval *r_rspdata;
} rep_extended_s;
typedef struct rep_search_s {
- AttributeName *r_attrs;
Entry *r_entry;
+ AttributeName *r_attrs;
+ int r_nentries;
BerVarray r_v2ref;
} rep_search_s;
LDAPControl **sr_ctrls;
union sr_u {
rep_sasl_s sru_sasl;
- rep_sresult_s sru_sresult;
rep_extended_s sru_extended;
rep_search_s sru_search;
} sr_un;
#define sr_attrs sr_un.sru_search.r_attrs
#define sr_entry sr_un.sru_search.r_entry
#define sr_v2ref sr_un.sru_search.r_v2ref
+#define sr_nentries sr_un.sru_search.r_nentries
#define sr_rspoid sr_un.sru_extended.r_rspoid
#define sr_rspdata sr_un.sru_extended.r_rspdata
#define sr_sasldata sr_un.sru_sasl.r_sasldata
-#define sr_nentries sr_un.sru_sresult.r_nentries
typedef int (BI_op_bind) LDAP_P(( struct slap_op *op, struct slap_rep *rs ));
typedef int (BI_op_unbind) LDAP_P(( struct slap_op *op, struct slap_rep *rs ));
#define o_tls_ssf o_authz.sai_tls_ssf
#define o_sasl_ssf o_authz.sai_sasl_ssf
-typedef void (slap_response)( struct slap_op *, struct slap_rep * );
-typedef void (slap_sresult)( struct slap_op *, struct slap_rep * );
-typedef int (slap_sendentry)( struct slap_op *, struct slap_rep * );
-typedef int (slap_sendreference)( struct slap_op *, struct slap_rep * );
+typedef int (slap_response)( struct slap_op *, struct slap_rep * );
typedef struct slap_callback {
slap_response *sc_response;
- slap_sresult *sc_sresult;
- slap_sendentry *sc_sendentry;
- slap_sendreference *sc_sendreference;
void *sc_private;
} slap_callback;
send_ldap_disconnect( op, rs ); } while (0)
typedef void (SEND_LDAP_RESULT)(struct slap_op *op, struct slap_rep *rs);
typedef int (SEND_SEARCH_ENTRY)(struct slap_op *op, struct slap_rep *rs);
-typedef void (SEND_SEARCH_RESULT)(struct slap_op *op, struct slap_rep *rs);
typedef int (SEND_SEARCH_REFERENCE)(struct slap_op *op, struct slap_rep *rs);
typedef void (SEND_LDAP_EXTENDED)(struct slap_op *op, struct slap_rep *rs);
typedef void (SEND_LDAP_INTERMEDIATE_RESP)(struct slap_op *op, struct slap_rep *rs);
(op->o_conn->c_send_ldap_result)( op, rs )
#define send_search_entry( op, rs ) \
(op->o_conn->c_send_search_entry)( op, rs )
-#define send_search_result( op, rs ) \
-(op->o_conn->c_send_search_result)( op, rs )
#define send_search_reference( op, rs ) \
(op->o_conn->c_send_search_reference)( op, rs )
#define send_ldap_extended( op, rs ) \
*/
SEND_LDAP_RESULT *c_send_ldap_result;
SEND_SEARCH_ENTRY *c_send_search_entry;
- SEND_SEARCH_RESULT *c_send_search_result;
SEND_SEARCH_REFERENCE *c_send_search_reference;
SEND_LDAP_EXTENDED *c_send_ldap_extended;
#ifdef LDAP_RES_INTERMEDIATE_RESP
LIBRARY = libslapi.la
-XLIBRARY = libtmpslapd.a
+#XLIBRARY = libtmpslapd.a
#all-common: $(LIBRARY) $(PROGRAMS)
# @touch plugin.c slapi_pblock.c slapi_utils.c slapi_ops.c
XINCPATH = -I.. -I$(srcdir)/..
XDEFS = $(MODULES_CPPFLAGS)
-UNIX_LINK_LIBS = ./libtmpslapd.a ../libbackends.a ../../../libraries/libavl/libavl.a ../../../libraries/liblber/.libs/liblber.a ../../../libraries/libldbm/libldbm.a ../../../libraries/libldif/libldif.a ../../../libraries/liblutil/liblutil.a ../../../libraries/liblunicode/liblunicode.a ../../../libraries/libldap_r/.libs/libldap_r.a ./libtmpslapd.a
+#UNIX_LINK_LIBS = ./libtmpslapd.a ../libbackends.a ../../../libraries/libavl/libavl.a ../../../libraries/liblber/.libs/liblber.a ../../../libraries/libldbm/libldbm.a ../../../libraries/libldif/libldif.a ../../../libraries/liblutil/liblutil.a ../../../libraries/liblunicode/liblunicode.a ../../../libraries/libldap_r/.libs/libldap_r.a ./libtmpslapd.a
BUILD_MOD = @BUILD_SLAPI@
Operation *op,
SlapReply *rs )
{
+ if (op->o_tag == LDAP_REQ_SEARCH)
+ slapi_pblock_set( (Slapi_PBlock *)op->o_pb,
+ SLAPI_NENTRIES, (void *)sr->sr_nentries );
+
return;
}
return LDAP_SUCCESS;
}
-static void
-internal_search_result(
- Operation *op,
- SlapReply *sr )
-{
- slapi_pblock_set( (Slapi_PBlock *)op->o_pb,
- SLAPI_NENTRIES, (void *)sr->sr_nentries );
-
- return;
-}
-
static void
internal_result_ext(
Operation *op,
pConn->c_send_ldap_result = internal_result_v3;
pConn->c_send_search_entry = internal_search_entry;
- pConn->c_send_search_result = internal_search_result;
pConn->c_send_ldap_extended = internal_result_ext;
pConn->c_send_search_reference = internal_search_reference;
rs.sr_ref = NULL;
rs.sr_ctrls = NULL;
+ slapi_pblock_get( pb, SLAPI_RESCONTROLS, &rs.sr_ctrls );
+
if ( err == LDAP_SASL_BIND_IN_PROGRESS ) {
slapi_pblock_get( pb, SLAPI_BIND_RET_SASLCREDS, (void *) &rs.sr_sasldata );
send_ldap_sasl( op, &rs );
return;
}
- rs.sr_type = REP_RESULT;
- slapi_pblock_get( pb, SLAPI_RESCONTROLS, &rs.sr_ctrls );
+ if (op->o_tag == LDAP_REQ_SEARCH)
+ rs.sr_nentries = nentries;
send_ldap_result( op, &rs );
#endif /* LDAP_SLAPI */
assert(0);
}
-void
-slap_send_search_result( Operation *op, SlapReply *rs )
-{
- assert(0);
-}
-
int
slap_send_search_entry( Operation *op, SlapReply *rs )
{