]> git.sur5r.net Git - openldap/commitdiff
Fix for CB_TAIL with cached results
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 15 Apr 2010 20:42:22 +0000 (20:42 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 15 Apr 2010 20:42:22 +0000 (20:42 +0000)
servers/slapd/overlays/pcache.c

index 699954357f8c009e1d690597a33b7c431c8ab51e..83705e0104319dfb643ecd18d0d2049ba11bb4a4 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);