mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
fix previous commit
This commit is contained in:
parent
79bc396ed8
commit
18360d1eb2
@ -177,6 +177,7 @@ glue_back_db_destroy (
|
|||||||
|
|
||||||
typedef struct glue_state {
|
typedef struct glue_state {
|
||||||
int err;
|
int err;
|
||||||
|
int is_slimit;
|
||||||
int slimit;
|
int slimit;
|
||||||
int matchlen;
|
int matchlen;
|
||||||
char *matched;
|
char *matched;
|
||||||
@ -191,7 +192,7 @@ glue_back_response ( Operation *op, SlapReply *rs )
|
|||||||
|
|
||||||
switch(rs->sr_type) {
|
switch(rs->sr_type) {
|
||||||
case REP_SEARCH:
|
case REP_SEARCH:
|
||||||
if ( rs->sr_nentries >= gs->slimit ) {
|
if ( gs->is_slimit && rs->sr_nentries >= gs->slimit ) {
|
||||||
gs->err = LDAP_SIZELIMIT_EXCEEDED;
|
gs->err = LDAP_SIZELIMIT_EXCEEDED;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -200,8 +201,14 @@ glue_back_response ( Operation *op, SlapReply *rs )
|
|||||||
return SLAP_CB_CONTINUE;
|
return SLAP_CB_CONTINUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (rs->sr_err == LDAP_SUCCESS || gs->err != LDAP_SUCCESS)
|
if ( gs->is_slimit && rs->sr_err == LDAP_SIZELIMIT_EXCEEDED
|
||||||
|
&& rs->sr_nentries >= gs->slimit ) {
|
||||||
|
gs->err = LDAP_SIZELIMIT_EXCEEDED;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (rs->sr_err == LDAP_SUCCESS || gs->err != LDAP_SUCCESS) {
|
||||||
gs->err = rs->sr_err;
|
gs->err = rs->sr_err;
|
||||||
|
}
|
||||||
if (gs->err == LDAP_SUCCESS && gs->matched) {
|
if (gs->err == LDAP_SUCCESS && gs->matched) {
|
||||||
ch_free (gs->matched);
|
ch_free (gs->matched);
|
||||||
gs->matched = NULL;
|
gs->matched = NULL;
|
||||||
@ -248,11 +255,13 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
|||||||
glueinfo *gi = (glueinfo *) b0->bd_info;
|
glueinfo *gi = (glueinfo *) b0->bd_info;
|
||||||
int i;
|
int i;
|
||||||
long stoptime = 0;
|
long stoptime = 0;
|
||||||
glue_state gs = {0, 0, 0, NULL, 0, NULL};
|
glue_state gs = {0, 0, 0, 0, NULL, 0, NULL};
|
||||||
slap_callback cb = { NULL, glue_back_response, NULL, NULL };
|
slap_callback cb = { NULL, glue_back_response, NULL, NULL };
|
||||||
int scope0, slimit0, tlimit0;
|
int scope0, slimit0, tlimit0;
|
||||||
struct berval dn, ndn;
|
struct berval dn, ndn;
|
||||||
|
|
||||||
|
gs.is_slimit = ( op->ors_slimit > 0 );
|
||||||
|
|
||||||
cb.sc_private = &gs;
|
cb.sc_private = &gs;
|
||||||
|
|
||||||
cb.sc_next = op->o_callback;
|
cb.sc_next = op->o_callback;
|
||||||
@ -279,7 +288,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
|||||||
op->o_callback = &cb;
|
op->o_callback = &cb;
|
||||||
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
|
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
|
||||||
scope0 = op->ors_scope;
|
scope0 = op->ors_scope;
|
||||||
slimit0 = gs.slimit = op->ors_slimit;
|
if ( gs.is_slimit ) {
|
||||||
|
slimit0 = gs.slimit = op->ors_slimit;
|
||||||
|
}
|
||||||
tlimit0 = op->ors_tlimit;
|
tlimit0 = op->ors_tlimit;
|
||||||
dn = op->o_req_dn;
|
dn = op->o_req_dn;
|
||||||
ndn = op->o_req_ndn;
|
ndn = op->o_req_ndn;
|
||||||
@ -297,7 +308,7 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (slimit0) {
|
if ( gs.is_slimit ) {
|
||||||
op->ors_slimit = slimit0 - rs->sr_nentries;
|
op->ors_slimit = slimit0 - rs->sr_nentries;
|
||||||
if (op->ors_slimit < 0) {
|
if (op->ors_slimit < 0) {
|
||||||
rs->sr_err = gs.err = LDAP_SIZELIMIT_EXCEEDED;
|
rs->sr_err = gs.err = LDAP_SIZELIMIT_EXCEEDED;
|
||||||
@ -348,7 +359,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
|||||||
}
|
}
|
||||||
end_of_loop:;
|
end_of_loop:;
|
||||||
op->ors_scope = scope0;
|
op->ors_scope = scope0;
|
||||||
op->ors_slimit = slimit0;
|
if ( gs.is_slimit ) {
|
||||||
|
op->ors_slimit = slimit0;
|
||||||
|
}
|
||||||
op->ors_tlimit = tlimit0;
|
op->ors_tlimit = tlimit0;
|
||||||
op->o_req_dn = dn;
|
op->o_req_dn = dn;
|
||||||
op->o_req_ndn = ndn;
|
op->o_req_ndn = ndn;
|
||||||
|
Loading…
Reference in New Issue
Block a user