Lines Matching refs:op
97 glue_op_cleanup( Operation *op, SlapReply *rs )
106 glue_op_response ( Operation *op, SlapReply *rs )
108 glue_state *gs = op->o_callback->sc_private;
167 newctrls = op->o_tmpalloc((i+1)*sizeof(LDAPControl *),
168 op->o_tmpmemctx);
173 if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
187 op->o_tmpfree(gs->ctrls[k], op->o_tmpmemctx);
195 newctrls = op->o_tmprealloc(gs->ctrls,
196 (j+i+1)*sizeof(LDAPControl *), op->o_tmpmemctx);
200 newctrls[j] = op->o_tmpalloc(sizeof(LDAPControl) + oidlen + 1 + rs->sr_ctrls[k]->ldctl_value.bv_len + 1,
201 op->o_tmpmemctx);
224 glue_op_func ( Operation *op, SlapReply *rs )
226 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
227 BackendDB *b0 = op->o_bd;
228 BackendInfo *bi0 = op->o_bd->bd_info;
233 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
236 if ( op->o_bd == b0 )
241 switch(op->o_tag) {
250 func = &op->o_bd->bd_info->bi_op_bind;
252 rc = func[which]( op, rs );
256 op->o_bd = b0;
257 op->o_bd->bd_info = bi0;
262 glue_op_abandon( Operation *op, SlapReply *rs )
264 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
266 BackendDB *b0 = op->o_bd;
267 BackendInfo *bi0 = op->o_bd->bd_info;
274 op->o_bd = gi->gi_n[i].gn_be;
275 if ( op->o_bd == b0 )
277 if ( op->o_bd->bd_info->bi_op_abandon )
278 op->o_bd->bd_info->bi_op_abandon( op, rs );
280 op->o_bd = b0;
281 op->o_bd->bd_info = bi0;
286 glue_response ( Operation *op, SlapReply *rs )
288 BackendDB *be = op->o_bd;
289 be = glue_back_select (op->o_bd, &op->o_req_ndn);
294 return ( op->o_bd == be ) ? SLAP_CB_CONTINUE : SLAP_CB_BYPASS;
298 glue_chk_referrals ( Operation *op, SlapReply *rs )
300 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
301 BackendDB *b0 = op->o_bd;
302 BackendInfo *bi0 = op->o_bd->bd_info;
305 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
306 if ( op->o_bd == b0 )
311 if ( op->o_bd->bd_info->bi_chk_referrals )
312 rc = ( *op->o_bd->bd_info->bi_chk_referrals )( op, rs );
316 op->o_bd = b0;
317 op->o_bd->bd_info = bi0;
322 glue_chk_controls ( Operation *op, SlapReply *rs )
324 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
325 BackendDB *b0 = op->o_bd;
326 BackendInfo *bi0 = op->o_bd->bd_info;
329 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
330 if ( op->o_bd == b0 )
339 if ( op->o_bd->bd_info->bi_chk_controls ) {
340 rc = ( *op->o_bd->bd_info->bi_chk_controls )( op, rs );
345 rc = backend_check_controls( op, rs );
348 op->o_bd = b0;
349 op->o_bd->bd_info = bi0;
361 glue_sub_search( Operation *op, SlapReply *rs, BackendDB *b0,
365 if ( op->o_bd == b0 && on->on_next ) {
366 BackendInfo *bi = op->o_bd->bd_info;
369 op->o_bd->bd_info = (BackendInfo *)on;
371 rc = on->on_bi.bi_op_search( op, rs );
376 op->o_bd->bd_info = bi;
380 return op->o_bd->be_search( op, rs );
387 glue_op_search ( Operation *op, SlapReply *rs )
389 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
391 BackendDB *b0 = op->o_bd;
393 BackendInfo *bi0 = op->o_bd->bd_info;
403 cb.sc_next = op->o_callback;
405 starttime = op->o_time;
406 stoptime = slap_get_time () + op->ors_tlimit;
409 if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED
410 && bvmatch( &((PagedResultsState *)op->o_pagedresults_state)->ps_cookieval, &gluecookie ) )
412 PagedResultsState *ps = op->o_pagedresults_state;
418 for (c = 0; op->o_ctrls[c] != NULL; c++) {
419 if (strcmp(op->o_ctrls[c]->ldctl_oid, LDAP_CONTROL_PAGEDRESULTS) == 0)
423 assert( op->o_ctrls[c] != NULL );
428 assert( op->o_ctrls[c]->ldctl_value.bv_len >= value.bv_len );
429 op->o_ctrls[c]->ldctl_value.bv_len = value.bv_len;
430 lutil_memcopy( op->o_ctrls[c]->ldctl_value.bv_val,
438 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
441 switch (op->ors_scope) {
443 if ( op->o_bd == b0 )
446 if (op->o_bd && op->o_bd->be_search) {
447 rs->sr_err = op->o_bd->be_search( op, rs );
456 op->o_callback = &cb;
458 scope0 = op->ors_scope;
459 tlimit0 = op->ors_tlimit;
460 dn = op->o_req_dn;
461 ndn = op->o_req_ndn;
462 b1 = op->o_bd;
479 if (get_no_subordinate_glue(op) && btmp != b1)
484 if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED &&
485 op->o_conn->c_pagedresults_state.ps_be &&
486 op->o_conn->c_pagedresults_state.ps_be != btmp )
490 op->o_time = slap_get_time();
491 op->ors_tlimit = stoptime - op->o_time;
492 if (op->ors_tlimit <= 0) {
501 if (op->o_abandon) {
504 op->o_bd = btmp;
506 assert( op->o_bd->be_suffix != NULL );
507 assert( op->o_bd->be_nsuffix != NULL );
513 op->ors_scope = LDAP_SCOPE_BASE;
514 mdn = op->o_req_dn = op->o_bd->be_suffix[0];
515 mndn = op->o_req_ndn = op->o_bd->be_nsuffix[0];
516 rs->sr_err = op->o_bd->be_search(op, rs);
520 op->ors_scope = LDAP_SCOPE_ONELEVEL;
521 if ( op->o_req_dn.bv_val == mdn.bv_val )
522 op->o_req_dn = dn;
523 if ( op->o_req_ndn.bv_val == mndn.bv_val )
524 op->o_req_ndn = ndn;
527 dn_match(&op->o_bd->be_nsuffix[0], &ndn))
529 rs->sr_err = glue_sub_search( op, rs, b0, on );
532 dnIsSuffix(&op->o_bd->be_nsuffix[0], &ndn))
535 mdn = op->o_req_dn = op->o_bd->be_suffix[0];
536 mndn = op->o_req_ndn = op->o_bd->be_nsuffix[0];
537 rs->sr_err = glue_sub_search( op, rs, b0, on );
541 if ( op->o_req_dn.bv_val == mdn.bv_val )
542 op->o_req_dn = dn;
543 if ( op->o_req_ndn.bv_val == mndn.bv_val )
544 op->o_req_ndn = ndn;
546 } else if (dnIsSuffix(&ndn, &op->o_bd->be_nsuffix[0])) {
547 rs->sr_err = glue_sub_search( op, rs, b0, on );
566 if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
567 PagedResultsState *ps = op->o_pagedresults_state;
570 op->o_conn->c_pagedresults_state.ps_be = NULL;
577 PagedResultsState *cps = &op->o_conn->c_pagedresults_state;
582 if ( op->o_bd != b0 &&
585 || op->o_bd != gi->gi_n[0].gn_be ) )
587 op->o_conn->c_pagedresults_state.ps_be = op->o_bd;
593 if ( op->o_bd != gi->gi_n[0].gn_be || cps->ps_cookie == NOID ) {
614 if ( BER_BVISEMPTY( &cookie ) && op->o_bd != gi->gi_n[0].gn_be ) {
622 op->o_conn->c_pagedresults_state.ps_be = gi->gi_n[gi->gi_nodes - 1].gn_be;
625 op->o_conn->c_pagedresults_state.ps_be = gi->gi_n[(i > 0 ? i - 1: 0)].gn_be;
635 newctrl = op->o_tmprealloc( gs.ctrls[c],
637 op->o_tmpmemctx);
649 } else if ( !BER_BVISEMPTY( &cookie ) && op->o_bd != b0 ) {
651 op->o_conn->c_pagedresults_state.ps_be = op->o_bd;
676 for (c = 0; op->o_ctrls[c] != NULL; c++) {
677 if (strcmp(op->o_ctrls[c]->ldctl_oid, LDAP_CONTROL_PAGEDRESULTS) == 0)
681 assert( op->o_ctrls[c] != NULL );
686 assert( op->o_ctrls[c]->ldctl_value.bv_len >= value.bv_len );
687 op->o_ctrls[c]->ldctl_value.bv_len = value.bv_len;
688 lutil_memcopy( op->o_ctrls[c]->ldctl_value.bv_val,
699 op->ors_scope = scope0;
700 op->ors_tlimit = tlimit0;
701 op->o_time = starttime;
706 op->o_callback = cb.sc_next;
707 if ( op->o_abandon ) {
716 send_ldap_result( op, rs );
718 op->o_bd = b0;
719 op->o_bd->bd_info = bi0;
726 op->o_tmpfree(gs.ctrls[i], op->o_tmpmemctx);
728 op->o_tmpfree(gs.ctrls, op->o_tmpmemctx);
900 Operation *op,
908 BackendDB *b0 = op->o_bd;
909 op->o_bd = glue_back_select( b0, dn );
911 if ( op->o_bd->be_fetch ) {
912 rc = op->o_bd->be_fetch( op, dn, oc, ad, rw, e );
916 op->o_bd =b0;
922 Operation *op,
927 BackendDB *b0 = op->o_bd;
930 op->o_bd = glue_back_select (b0, &e->e_nname);
932 if ( op->o_bd->be_release ) {
933 rc = op->o_bd->be_release( op, e, rw );
942 op->o_bd = b0;
1502 Operation *op,
1510 BackendDB *b0, *be = glue_back_select( op->o_bd, &e->e_nname );
1513 if ( be == NULL || be == op->o_bd || be->bd_info->bi_access_allowed == NULL )
1516 b0 = op->o_bd;
1517 op->o_bd = be;
1518 rc = be->bd_info->bi_access_allowed ( op, e, desc, val, access, state, maskp );
1519 op->o_bd = b0;