diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-14 10:32:46 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-15 10:29:34 -0700 |
commit | 529b056b2fda91263730da1da8ac9b42b54b72f4 (patch) | |
tree | 32565ec3ea975a9af2617eba667201345af7a631 /ldap/servers/slapd/back-ldbm | |
parent | 20d1e7c8e9280e2175ca843f60a50addc096f134 (diff) | |
download | ds-529b056b2fda91263730da1da8ac9b42b54b72f4.tar.gz ds-529b056b2fda91263730da1da8ac9b42b54b72f4.tar.xz ds-529b056b2fda91263730da1da8ac9b42b54b72f4.zip |
Bug 558099 - Enhancement request: Log more information about the search result being a paged one
https://bugzilla.redhat.com/show_bug.cgi?id=558099
Description: searched entry count is logged in the access log as
(nentries=<num>). When RFC 2696 page results control is passed,
the nentries logs the page size instead of the total searched
count. andrey.ivanov@polytechnique.fr proposed to log the control
info as follows:
[..] conn=# op=#RESULT err=0 tag=101 nentries=# etime=0 notes=P
This patch implemented the spec.
Also, there was a bug regarding unindexed note "notes=U" when
the paged results control is received. Only the first page logs
it, but not the rest. The bug was fixed.
Diffstat (limited to 'ldap/servers/slapd/back-ldbm')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/filterindex.c | 6 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/ldbm_search.c | 1 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/vlv.c | 5 |
3 files changed, 10 insertions, 2 deletions
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c index 03123ca6..e2377494 100644 --- a/ldap/servers/slapd/back-ldbm/filterindex.c +++ b/ldap/servers/slapd/back-ldbm/filterindex.c @@ -287,6 +287,7 @@ ava_candidates( if ( unindexed ) { unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED; slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); } /* We don't use valuearray_free here since the valueset, berval @@ -318,6 +319,7 @@ ava_candidates( if ( unindexed ) { unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED; slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); } valuearray_free( &ivals ); LDAPDebug( LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n", @@ -353,6 +355,7 @@ presence_candidates( if ( unindexed ) { unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED; slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); } if (idl != NULL && ALLIDS(idl) && strcasecmp(type, "nscpentrydn") == 0) { @@ -458,6 +461,7 @@ extensible_candidates( unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED; slapi_pblock_set( glob_pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( glob_pb->pb_conn ); } if (idl2 == NULL) { @@ -864,6 +868,7 @@ substring_candidates( attr_done(&sattr); if ( ivals == NULL || *ivals == NULL ) { slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); LDAPDebug( LDAP_DEBUG_TRACE, "<= sub_candidates ALLIDS (no keys)\n", 0, 0, 0 ); return( idl_allids( be ) ); @@ -876,6 +881,7 @@ substring_candidates( idl = keys2idl( be, type, indextype_SUB, ivals, err, &unindexed ); if ( unindexed ) { slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); } valuearray_free( &ivals ); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c index 0f97d861..9a8dd0fd 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_search.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c @@ -675,6 +675,7 @@ ldbm_back_search( Slapi_PBlock *pb ) } slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); } sr->sr_candidates = candidates; diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c index 0d282400..163d8a64 100644 --- a/ldap/servers/slapd/back-ldbm/vlv.c +++ b/ldap/servers/slapd/back-ldbm/vlv.c @@ -1150,8 +1150,9 @@ vlv_search_build_candidate_list(Slapi_PBlock *pb, const Slapi_DN *base, int *vlv if((pi=vlv_find_search(be, base, scope, fstr, sort_control)) == NULL) { unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED; PR_RWLock_Unlock(be->vlvSearchList_lock); - slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); - rc = VLV_FIND_SEARCH_FAILED; + slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); + pagedresults_set_unindexed( pb->pb_conn ); + rc = VLV_FIND_SEARCH_FAILED; } else if((*vlv_rc=vlvIndex_accessallowed(pi, pb)) != LDAP_SUCCESS) { PR_RWLock_Unlock(be->vlvSearchList_lock); rc = VLV_ACCESS_DENIED; |