From: Ralf Haferkamp Date: Thu, 5 Jun 2003 17:35:12 +0000 (+0000) Subject: removed caching X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~930 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=851407f4e4073315114065eecc8c69533cf5db52;p=openldap removed caching --- diff --git a/contrib/ldapc++/src/LDAPAddRequest.cpp b/contrib/ldapc++/src/LDAPAddRequest.cpp index b3a1a4d099..ab07749dca 100644 --- a/contrib/ldapc++/src/LDAPAddRequest.cpp +++ b/contrib/ldapc++/src/LDAPAddRequest.cpp @@ -37,8 +37,6 @@ LDAPAddRequest::LDAPAddRequest(const LDAPEntry* entry, LDAPAddRequest::~LDAPAddRequest(){ DEBUG(LDAP_DEBUG_DESTROY, "LDAPAddRequest::~LDAPAddRequest()" << endl); delete m_entry; - // flush the cache, as the add may affect searches - m_connection->flush_cache(); } LDAPMessageQueue* LDAPAddRequest::sendRequest(){ diff --git a/contrib/ldapc++/src/LDAPAsynConnection.cpp b/contrib/ldapc++/src/LDAPAsynConnection.cpp index 6a5d5c464c..74011169f5 100644 --- a/contrib/ldapc++/src/LDAPAsynConnection.cpp +++ b/contrib/ldapc++/src/LDAPAsynConnection.cpp @@ -39,9 +39,6 @@ LDAPAsynConnection::LDAPAsynConnection(const string& hostname, int port, LDAPAsynConnection::~LDAPAsynConnection(){ DEBUG(LDAP_DEBUG_DESTROY, "LDAPAsynConnection::~LDAPAsynConnection()" << endl); - if (cur_session){ - ldap_destroy_cache(cur_session); - } unbind(); //delete m_constr; } @@ -295,26 +292,3 @@ LDAPAsynConnection* LDAPAsynConnection::referralConnect( return 0; } -int LDAPAsynConnection::enableCache(long timeout, long maxmem){ - int retval = ldap_enable_cache(cur_session, timeout, maxmem); - if (!retval) - m_cacheEnabled = true; - return retval; -} - -void LDAPAsynConnection::disableCache(){ - ldap_disable_cache(cur_session); - m_cacheEnabled = false; -} - -void LDAPAsynConnection::uncache_entry(string &dn){ - if (m_cacheEnabled){ - ldap_uncache_entry(cur_session, dn.c_str()); - } -} - -void LDAPAsynConnection::flush_cache(){ - if (m_cacheEnabled){ - ldap_flush_cache(cur_session); - } -} diff --git a/contrib/ldapc++/src/LDAPAsynConnection.h b/contrib/ldapc++/src/LDAPAsynConnection.h index fdef9ccd5f..ed217d01cd 100644 --- a/contrib/ldapc++/src/LDAPAsynConnection.h +++ b/contrib/ldapc++/src/LDAPAsynConnection.h @@ -286,22 +286,6 @@ class LDAPAsynConnection{ LDAPUrlList::const_iterator& usedUrl, const LDAPConstraints* cons) const; - /** - * Turn on caching, maxmem is in MB and timeout is in seconds. - * maxmem can be zero if you want to restrict caching by timeout only. - */ - int enableCache(long timeout, long maxmem); - /// disable caching. - void disableCache(); - /// is cacheEnabled? - bool getCacheEnabled() { return m_cacheEnabled;}; - /// uncache a specific dn. Used internally by methods that write. - void uncache_entry(std::string &dn); - /// used to clear the cache. Probably should be used after creating - /// an object that a cached search should find. - void flush_cache(); - - private : /** * Private copy constructor. So nobody can call it. diff --git a/contrib/ldapc++/src/LDAPConnection.cpp b/contrib/ldapc++/src/LDAPConnection.cpp index 71165ea852..821f2ec03c 100644 --- a/contrib/ldapc++/src/LDAPConnection.cpp +++ b/contrib/ldapc++/src/LDAPConnection.cpp @@ -334,26 +334,3 @@ void LDAPConnection::setConstraints(LDAPConstraints* cons){ const LDAPConstraints* LDAPConnection::getConstraints() const{ return LDAPAsynConnection::getConstraints(); } - -int LDAPConnection::enableCache(long timeout, long maxmem) { - return LDAPAsynConnection::enableCache(timeout, maxmem); -} - - -void LDAPConnection::disableCache() { - LDAPAsynConnection::disableCache(); -} - -bool LDAPConnection::getCacheEnabled() { - return LDAPAsynConnection::getCacheEnabled(); -} - -void LDAPConnection::uncache_entry(string &dn) { - LDAPAsynConnection::uncache_entry(dn); -} - -void LDAPConnection::flush_cache() -{ - LDAPAsynConnection::flush_cache(); -} - diff --git a/contrib/ldapc++/src/LDAPConnection.h b/contrib/ldapc++/src/LDAPConnection.h index 93acf618cc..b18842d88e 100644 --- a/contrib/ldapc++/src/LDAPConnection.h +++ b/contrib/ldapc++/src/LDAPConnection.h @@ -229,22 +229,6 @@ class LDAPConnection : private LDAPAsynConnection { void setConstraints(LDAPConstraints *cons); const LDAPConstraints* getConstraints() const ; - - /** - * Turn on caching, maxmem is in MB and timeout is in seconds. - * maxmem can be zero if you want to restrict caching by timeout only. - */ - int enableCache(long timeout, long maxmem); - /// disable caching. - void disableCache(); - /// is cacheEnabled? - bool getCacheEnabled(); - /// uncache a specific dn. Used internally by methods that write. - void uncache_entry(std::string &dn); - /// used to clear the cache. Probably should be used after creating - /// an object that a cached search should find. - void flush_cache(); - }; #endif //LDAP_CONNECTION_H diff --git a/contrib/ldapc++/src/LDAPDeleteRequest.cpp b/contrib/ldapc++/src/LDAPDeleteRequest.cpp index 78d086f5fc..66c79b16e9 100644 --- a/contrib/ldapc++/src/LDAPDeleteRequest.cpp +++ b/contrib/ldapc++/src/LDAPDeleteRequest.cpp @@ -35,10 +35,6 @@ LDAPDeleteRequest::LDAPDeleteRequest(const string& dn, LDAPDeleteRequest::~LDAPDeleteRequest(){ DEBUG(LDAP_DEBUG_DESTROY, "LDAPDeleteRequest::~LDAPDeleteRequest()" << endl); - // TODO -- flush the entire cache here? or does this invalidate - // cached searches that may have found the deleted entry. - // m_connection->uncache_entry(m_dn); - m_connection->flush_cache(); } LDAPMessageQueue* LDAPDeleteRequest::sendRequest(){ diff --git a/contrib/ldapc++/src/LDAPModDNRequest.cpp b/contrib/ldapc++/src/LDAPModDNRequest.cpp index 0d96437079..d50c04f289 100644 --- a/contrib/ldapc++/src/LDAPModDNRequest.cpp +++ b/contrib/ldapc++/src/LDAPModDNRequest.cpp @@ -44,9 +44,6 @@ LDAPModDNRequest::LDAPModDNRequest(const string& dn, const string& newRDN, LDAPModDNRequest::~LDAPModDNRequest(){ DEBUG(LDAP_DEBUG_DESTROY, "LDAPModDNRequest::~LDAPModDNRequest()" << endl); - // flush entries from the cache. - m_connection->uncache_entry(m_dn); - m_connection->uncache_entry(m_newRDN); } LDAPMessageQueue* LDAPModDNRequest::sendRequest(){ diff --git a/contrib/ldapc++/src/LDAPModifyRequest.cpp b/contrib/ldapc++/src/LDAPModifyRequest.cpp index 3d688ca353..310ececcb3 100644 --- a/contrib/ldapc++/src/LDAPModifyRequest.cpp +++ b/contrib/ldapc++/src/LDAPModifyRequest.cpp @@ -39,10 +39,6 @@ LDAPModifyRequest::~LDAPModifyRequest(){ DEBUG(LDAP_DEBUG_DESTROY, "LDAPModifyRequest::~LDAPModifyRequest()" << endl); delete m_modList; - // flush this entry from cache. - //m_connection->uncache_entry(m_dn); - // I think we need to do this... (j.costlow) - m_connection->flush_cache(); } LDAPMessageQueue* LDAPModifyRequest::sendRequest(){ diff --git a/contrib/ldapc++/src/config.h.in b/contrib/ldapc++/src/config.h.in index d2c1714044..7d4dbab085 100644 --- a/contrib/ldapc++/src/config.h.in +++ b/contrib/ldapc++/src/config.h.in @@ -1,17 +1,62 @@ -/* src/config.h.in. Generated automatically from configure.in by autoheader. */ +/* src/config.h.in. Generated from configure.in by autoheader. */ #undef WITH_DEBUG -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define if you have the `resolv' library (-lresolv). */ +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + /* Name of package */ #undef PACKAGE -/* Define if you can safely include both and . */ +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */