From: Luke Howard Date: Sat, 1 Feb 2003 07:04:13 +0000 (+0000) Subject: Add sendreference callback X-Git-Tag: NO_SLAP_OP_BLOCKS~454 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dfc7d338a6c1c0213f1423896ab0223b23fb97f2;p=openldap Add sendreference callback --- diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 591cff21a9..69c102d231 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -275,6 +275,31 @@ glue_back_sendentry ( return rc; } +static int +glue_back_sendreference ( + BackendDB *be, + Connection *c, + Operation *op, + Entry *e, + BerVarray bv, + LDAPControl **ctrls, + BerVarray *v2 +) +{ + slap_callback *tmp = op->o_callback; + glue_state *gs = tmp->sc_private; + int rc; + + op->o_callback = gs->prevcb; + if (op->o_callback && op->o_callback->sc_sendreference) { + rc = op->o_callback->sc_sendreference( be, c, op, e, bv, ctrls, v2 ); + } else { + rc = send_search_reference( be, c, op, e, bv, ctrls, v2 ); + } + op->o_callback = tmp; + return rc; +} + static int glue_back_search ( BackendDB *b0, diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 51f1c1eb86..de11528d19 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -918,6 +918,7 @@ LDAP_SLAPD_F (int) slap_sasl_regexp_config LDAP_P(( 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; /* diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 1d87d21506..fcae73adf0 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -1299,6 +1299,10 @@ slap_send_search_reference( AttributeDescription *ad_ref = slap_schema.si_ad_ref; AttributeDescription *ad_entry = slap_schema.si_ad_entry; + if (op->o_callback && op->o_callback->sc_sendreference) { + return op->o_callback->sc_sendreference( be, conn, op, e, refs, ctrls, v2refs ); + } + #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ENTRY, "send_search_reference: conn %lu dn=\"%s\"\n", diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 23c5532b34..9980b79ab5 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -341,6 +341,12 @@ void slap_cb_null_sresult( Connection *conn, Operation *o, ber_int_t err, { } +int slap_cb_null_sreference( BackendDB *db, Connection *conn, Operation *o, + Entry *e, BerVarray r, LDAPControl **c, BerVarray *v2) +{ + return 0; +} + /* This callback actually does some work...*/ static int sasl_sc_sasl2dn( BackendDB *be, Connection *conn, Operation *o, Entry *e, AttributeName *an, int ao, LDAPControl **c) @@ -564,7 +570,7 @@ void slap_sasl2dn( Connection *conn, int scope = LDAP_SCOPE_BASE; Filter *filter = NULL; slap_callback cb = { slap_cb_null_response, - slap_cb_null_sresult, sasl_sc_sasl2dn, NULL}; + slap_cb_null_sresult, sasl_sc_sasl2dn, slap_cb_null_sreference, NULL}; Operation op = {0}; struct berval regout = { 0, NULL }; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 791f91f02f..a0a1b920d6 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1593,10 +1593,14 @@ typedef void (slap_sresult)( struct slap_conn *, struct slap_op *, typedef int (slap_sendentry)( BackendDB *, struct slap_conn *, struct slap_op *, Entry *, AttributeName *, int, LDAPControl **); +typedef int (slap_sendreference)( BackendDB *, struct slap_conn *, + struct slap_op *, Entry *, BerVarray, LDAPControl **, BerVarray * ); + 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; @@ -1880,11 +1884,11 @@ typedef struct slap_conn { void *c_pb; /* Netscape plugin */ - /* + /* * These are the "callbacks" that are available for back-ends to * supply data back to connected clients that are connected * through the "front-end". - */ + */ SEND_LDAP_RESULT c_send_ldap_result; SEND_SEARCH_ENTRY c_send_search_entry; SEND_SEARCH_RESULT c_send_search_result;