From 09f749da96af6d269fb976e817aa187ad542c2fc Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 7 Aug 2005 20:43:07 +0000 Subject: [PATCH] remove unnecessary data from search_info --- servers/slapd/back-sql/add.c | 1 - servers/slapd/back-sql/back-sql.h | 2 -- servers/slapd/back-sql/bind.c | 1 - servers/slapd/back-sql/compare.c | 4 +--- servers/slapd/back-sql/delete.c | 2 -- servers/slapd/back-sql/init.c | 2 -- servers/slapd/back-sql/modify.c | 1 - servers/slapd/back-sql/modrdn.c | 4 ---- servers/slapd/back-sql/operational.c | 1 - servers/slapd/back-sql/proto-sql.h | 2 +- servers/slapd/back-sql/search.c | 11 +---------- 11 files changed, 3 insertions(+), 28 deletions(-) diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 03fb03f5bd..d8f3842366 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -1102,7 +1102,6 @@ backsql_add( Operation *op, SlapReply *rs ) bsi.bsi_e = &p; rs->sr_err = backsql_init_search( &bsi, &pdn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); if ( rs->sr_err != LDAP_SUCCESS ) { diff --git a/servers/slapd/back-sql/back-sql.h b/servers/slapd/back-sql/back-sql.h index 21c152e2b1..78ca48e791 100644 --- a/servers/slapd/back-sql/back-sql.h +++ b/servers/slapd/back-sql/back-sql.h @@ -436,8 +436,6 @@ typedef struct backsql_srch_info { * is used */ #define BACKSQL_SCOPE_BASE_LIKE ( LDAP_SCOPE_BASE | 0x1000 ) Filter *bsi_filter; - int bsi_slimit, - bsi_tlimit; time_t bsi_stoptime; backsql_entryID *bsi_id_list, diff --git a/servers/slapd/back-sql/bind.c b/servers/slapd/back-sql/bind.c index 0bc12e5a24..a4284437f7 100644 --- a/servers/slapd/back-sql/bind.c +++ b/servers/slapd/back-sql/bind.c @@ -76,7 +76,6 @@ backsql_bind( Operation *op, SlapReply *rs ) bsi.bsi_e = &e; rc = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, anlist, BACKSQL_ISF_GET_ENTRY ); if ( rc != LDAP_SUCCESS ) { diff --git a/servers/slapd/back-sql/compare.c b/servers/slapd/back-sql/compare.c index 9baf9ff35d..bc5d166c3d 100644 --- a/servers/slapd/back-sql/compare.c +++ b/servers/slapd/back-sql/compare.c @@ -60,9 +60,7 @@ backsql_compare( Operation *op, SlapReply *rs ) * Get the entry */ bsi.bsi_e = &e; - rc = backsql_init_search( &bsi, &op->o_req_ndn, - LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, + rc = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, (time_t)(-1), NULL, dbh, op, rs, anlist, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); switch ( rc ) { diff --git a/servers/slapd/back-sql/delete.c b/servers/slapd/back-sql/delete.c index d58442787e..1f059c2895 100644 --- a/servers/slapd/back-sql/delete.c +++ b/servers/slapd/back-sql/delete.c @@ -115,7 +115,6 @@ backsql_delete( Operation *op, SlapReply *rs ) bsi.bsi_e = &d; rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); switch ( rs->sr_err ) { @@ -223,7 +222,6 @@ backsql_delete( Operation *op, SlapReply *rs ) e_id = bsi.bsi_base_id; rs->sr_err = backsql_init_search( &bsi, &pdn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs, BACKSQL_ISF_GET_ENTRY ); if ( rs->sr_err != LDAP_SUCCESS ) { diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index a2e6f5948f..1fd226586a 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -569,8 +569,6 @@ backsql_db_close( int backsql_connection_destroy( Backend *bd, Connection *c ) { - backsql_info *bi = (backsql_info*)bd->be_private; - char opbuf[ OPERATION_BUFFER_SIZE ]; Operation* op = (Operation *)opbuf; diff --git a/servers/slapd/back-sql/modify.c b/servers/slapd/back-sql/modify.c index 79644cb969..c9060f98eb 100644 --- a/servers/slapd/back-sql/modify.c +++ b/servers/slapd/back-sql/modify.c @@ -65,7 +65,6 @@ backsql_modify( Operation *op, SlapReply *rs ) bsi.bsi_e = &m; rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_all_attributes, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); diff --git a/servers/slapd/back-sql/modrdn.c b/servers/slapd/back-sql/modrdn.c index 242a1110c2..306e557d02 100644 --- a/servers/slapd/back-sql/modrdn.c +++ b/servers/slapd/back-sql/modrdn.c @@ -74,7 +74,6 @@ backsql_modrdn( Operation *op, SlapReply *rs ) bsi.bsi_e = &r; rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_all_attributes, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); @@ -171,7 +170,6 @@ backsql_modrdn( Operation *op, SlapReply *rs ) e_id = bsi.bsi_base_id; rs->sr_err = backsql_init_search( &bsi, &pndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_all_attributes, BACKSQL_ISF_GET_ENTRY ); @@ -226,7 +224,6 @@ backsql_modrdn( Operation *op, SlapReply *rs ) bsi.bsi_e = &n; rs->sr_err = backsql_init_search( &bsi, new_npdn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_all_attributes, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); @@ -455,7 +452,6 @@ backsql_modrdn( Operation *op, SlapReply *rs ) bsi.bsi_e = &r; rs->sr_err = backsql_init_search( &bsi, &new_ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, slap_anlist_all_attributes, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); diff --git a/servers/slapd/back-sql/operational.c b/servers/slapd/back-sql/operational.c index 2fc2ac0855..6edde629ca 100644 --- a/servers/slapd/back-sql/operational.c +++ b/servers/slapd/back-sql/operational.c @@ -184,7 +184,6 @@ backsql_operational( rc = backsql_init_search( &bsi, &rs->sr_entry->e_nname, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, NULL, BACKSQL_ISF_GET_ID ); if ( rc != LDAP_SUCCESS ) { diff --git a/servers/slapd/back-sql/proto-sql.h b/servers/slapd/back-sql/proto-sql.h index 7300b3008a..7112812b86 100644 --- a/servers/slapd/back-sql/proto-sql.h +++ b/servers/slapd/back-sql/proto-sql.h @@ -164,7 +164,7 @@ int backsql_destroy_schema_map( backsql_info *si ); */ int backsql_init_search( backsql_srch_info *bsi, - struct berval *nbase, int scope, int slimit, int tlimit, + struct berval *nbase, int scope, time_t stoptime, Filter *filter, SQLHDBC dbh, Operation *op, SlapReply *rs, AttributeName *attrs, unsigned flags ); diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index b883750fb3..d272ef724f 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -109,8 +109,6 @@ backsql_init_search( backsql_srch_info *bsi, struct berval *nbase, int scope, - int slimit, - int tlimit, time_t stoptime, Filter *filter, SQLHDBC dbh, @@ -127,8 +125,6 @@ backsql_init_search( BER_BVZERO( &bsi->bsi_base_id.eid_dn ); BER_BVZERO( &bsi->bsi_base_id.eid_ndn ); bsi->bsi_scope = scope; - bsi->bsi_slimit = slimit; - bsi->bsi_tlimit = tlimit; bsi->bsi_filter = filter; bsi->bsi_dbh = dbh; bsi->bsi_op = op; @@ -1827,7 +1823,6 @@ backsql_search( Operation *op, SlapReply *rs ) bsi.bsi_e = &base_entry; rs->sr_err = backsql_init_search( &bsi, &op->o_req_ndn, op->ors_scope, - op->ors_slimit, op->ors_tlimit, stoptime, op->ors_filter, dbh, op, rs, op->ors_attrs, ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) ); @@ -2079,7 +2074,6 @@ backsql_search( Operation *op, SlapReply *rs ) rc = backsql_init_search( &bsi2, &e->e_nname, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, rs, NULL, BACKSQL_ISF_GET_ENTRY ); @@ -2217,9 +2211,7 @@ next_entry:; } next_entry2:; - if ( op->ors_slimit != SLAP_NO_LIMIT - && rs->sr_nentries >= op->ors_slimit ) - { + if ( --op->ors_slimit == -1 ) { rs->sr_err = LDAP_SIZELIMIT_EXCEEDED; goto send_results; } @@ -2335,7 +2327,6 @@ backsql_entry_get( rc = backsql_init_search( &bsi, ndn, LDAP_SCOPE_BASE, - SLAP_NO_LIMIT, SLAP_NO_LIMIT, (time_t)(-1), NULL, dbh, op, &rs, at ? anlist : NULL, BACKSQL_ISF_GET_ENTRY );