]> git.sur5r.net Git - openldap/commitdiff
Fix for CB_TAIL with cached results
authorHoward Chu <hyc@openldap.org>
Wed, 10 Mar 2010 22:25:42 +0000 (22:25 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 10 Mar 2010 22:25:42 +0000 (22:25 +0000)
servers/slapd/overlays/pcache.c

index 3623f37245ee3c9f0b52399fd103c801ff147b80..1b75814fba5899415d76003168e60a06f72556c7 100644 (file)
@@ -3018,14 +3018,22 @@ pcache_op_search(
                                pbi->bi_cq = answerable;
 
                        op->o_bd = &cm->db;
-#if 0
                        if ( cm->response_cb == PCACHE_RESPONSE_CB_TAIL ) {
+                               slap_callback cb;
                                /* The cached entry was already processed by any
                                 * other overlays, so don't let it get processed again.
+                                *
+                                * This loop removes over_back_response from the stack.
                                 */
-                               op->o_callback = NULL;
+                               if ( overlay_callback_after_backover( op, &cb, 0) == 0 ) {
+                                       slap_callback **scp;
+                                       for ( scp = &op->o_callback; *scp != NULL;
+                                               scp = &(*scp)->sc_next ) {
+                                               if ( (*scp)->sc_next == &cb )
+                                                       *scp = cb.sc_next;
+                                       }
+                               }
                        }
-#endif
                        i = cm->db.bd_info->bi_op_search( op, rs );
                }
                ldap_pvt_thread_rdwr_runlock(&answerable->rwlock);