]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backover.c
Skip spurious Statslog's for callback-intercepted responses.
[openldap] / servers / slapd / backover.c
index 6a36f7880b173092abf8e2131fb9cc59b0e233e6..21ced8051a2ebf60a195974c20b2a8ad5e54e5c8 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003 The OpenLDAP Foundation.
+ * Copyright 2003-2004 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -134,11 +134,8 @@ over_back_response ( Operation *op, SlapReply *rs )
        slap_overinst *on = oi->oi_list;
        int rc = SLAP_CB_CONTINUE;
        BackendDB *be = op->o_bd, db = *op->o_bd;
-       slap_callback *sc = op->o_callback->sc_private;
-       slap_callback *s0 = op->o_callback;
 
        op->o_bd = &db;
-       op->o_callback = sc;
        for (; on; on=on->on_next ) {
                if ( on->on_response ) {
                        db.bd_info = (BackendInfo *)on;
@@ -146,11 +143,7 @@ over_back_response ( Operation *op, SlapReply *rs )
                        if ( rc != SLAP_CB_CONTINUE ) break;
                }
        }
-       if ( sc && (rc == SLAP_CB_CONTINUE) ) {
-               rc = sc->sc_response( op, rs );
-       }
        op->o_bd = be;
-       op->o_callback = s0;
        return rc;
 }
 
@@ -169,11 +162,11 @@ over_op_func(
        slap_overinst *on = oi->oi_list;
        BI_op_bind **func;
        BackendDB *be = op->o_bd, db = *op->o_bd;
-       slap_callback cb = {over_back_response, NULL};
+       slap_callback cb = {NULL, over_back_response, NULL, NULL};
        int rc = SLAP_CB_CONTINUE;
 
        op->o_bd = &db;
-       cb.sc_private = op->o_callback;
+       cb.sc_next = op->o_callback;
        op->o_callback = &cb;
 
        for (; on; on=on->on_next ) {
@@ -194,7 +187,7 @@ over_op_func(
        if ( rc == SLAP_CB_CONTINUE ) {
                rc = LDAP_UNWILLING_TO_PERFORM;
        }
-       op->o_callback = cb.sc_private;
+       op->o_callback = cb.sc_next;
        return rc;
 }
 
@@ -325,6 +318,7 @@ overlay_config( BackendDB *be, const char *ov )
                be->bd_info = bi;
        }
 
+#if 0
        /* Walk to the end of the list of overlays, add the new
         * one onto the end
         */
@@ -339,6 +333,16 @@ overlay_config( BackendDB *be, const char *ov )
        *on2 = *on;
        on2->on_next = NULL;
        on2->on_info = oi;
+#else
+       /* Insert new overlay on head of list. Overlays are executed
+        * in reverse of config order...
+        */
+       on2 = ch_calloc( 1, sizeof(slap_overinst) );
+       *on2 = *on;
+       on2->on_info = oi;
+       on2->on_next = oi->oi_list;
+       oi->oi_list = on2;
+#endif
 
        /* Any initialization needed? */
        if ( on->on_bi.bi_db_init ) {