]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/cache.h
Fix prev commit, return generated passwd
[openldap] / servers / slapd / back-meta / cache.h
index fc8621d6551e8d26b61d2d4f06de34db0d9d17bb..6a7525fc87dca84afab69fe54dc6ebd6c7367c82 100644 (file)
@@ -1,36 +1,29 @@
-/* Copyright (c) 2003 by International Business Machines, Inc.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute 
-this
- * Software with or without fee, provided that the above copyright notice 
-and
- * all paragraphs of this notice appear in all copies, and that the name 
-of IBM
- * not be used in connection with the marketing of any product 
-incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
+ * Copyright 1999-2003 The OpenLDAP Foundation.
+ * Portions Copyright 2003 IBM Corporation.
+ * All rights reserved.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER 
-ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, 
-EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by the Apurva Kumar for inclusion
+ * in OpenLDAP Software.
  */
-
 
 #ifndef META_CACHE_H
 #define META_CACHE_H
 #include "slap.h"
 
-#ifdef LDAP_CACHING
 /* cache specific errors */
-enum type_of_result 
-{ 
+enum type_of_result { 
     SUCCESS, 
     CONN_ERR, 
     RESULT_ERR, 
@@ -141,12 +134,13 @@ typedef struct cache_manager_s {
         int     num_entries_limit;             /* max # of entries in a cacheable query */ 
        int     threads;                        /* number of threads currently in meta_back_search */ 
 
-       int     consistency_cycle_time;         /* interval between successive consistency checks (sec) */ 
-       int     consistency_time;               /* time when consistency check was last performed (sec) */ 
+       int     cc_period;              /* interval between successive consistency checks (sec) */ 
+       int     cc_thread_started; 
+       ldap_pvt_thread_t   cc_thread; 
 
        ldap_pvt_thread_mutex_t         cache_mutex;            
        ldap_pvt_thread_mutex_t         remove_mutex;
-       ldap_pvt_thread_mutex_t         consistency_mutex;      
+       ldap_pvt_thread_mutex_t         cc_mutex;       
 
        query_manager*   qm;    /* query cache managed by the cache manager */ 
 } cache_manager; 
@@ -154,19 +148,8 @@ typedef struct cache_manager_s {
 /* search-cache.c */
 int
 meta_back_cache_search(
-    Backend            *be,
-    Connection         *conn,
     Operation          *op,
-    struct berval      *base,
-    struct berval      *nbase,
-    int                        scope,
-    int                        deref,
-    int                        slimit,
-    int                        tlimit,
-    Filter             *filt,
-    struct berval      *filterstr,
-    AttributeName      *attributes,
-    int                        attrsonly
+    SlapReply          *rs
 ); 
 
 /* config-cache.c */
@@ -203,11 +186,11 @@ filter2template( Filter *f,
 /* merge.c */
 
 int
-merge_entry (Backend* be,
-           Connection* conn
-           Entry* e, 
-           struct bervalquery_uuid, 
-           struct exceptionresult
+merge_entry (
+           Operation           *op
+           SlapReply           *rs,
+           struct berval       *query_uuid, 
+           struct exception    *result
 ); 
 
 int 
@@ -216,37 +199,12 @@ get_entry_size(Entry* e,
               struct exception* result
 ); 
 
-void 
-callback_null_response( Connection *conn, 
-                      Operation *o, 
-                      ber_tag_t tag,
-                      ber_int_t msgid, 
-                      ber_int_t err, 
-                      const char *matched,
-                      const char *text, 
-                      BerVarray ref, 
-                      const char *resoid,
-                      struct berval *resdata, 
-                      struct berval *sasldata, 
-                      LDAPControl **c
-);
-
-void callback_null_sresult( Connection *conn, 
-                          Operation *o, 
-                          ber_int_t err,
-                          const char *matched, 
-                          const char *text, 
-                          BerVarray refs, 
-                          LDAPControl **c,
-                          int nentries
-); 
-
 /* remove.c */
 int 
-remove_query_data (Backend* be,
-                  Connection* conn, 
+remove_query_data (
+                  Operation* conn,
+                  SlapReply *rs,
                   struct berval* query_uuid, 
                   struct exception* result
 );
 #endif
-#endif