]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPConnection.cpp
Entry rwlock is no longer needed as concurrency is managed
[openldap] / contrib / ldapc++ / src / LDAPConnection.cpp
index 7baa9333a77162f02809b36adfd23f111824e4d1..2ccda4a0cea4670454c8b1d75f3ee210c680d6b4 100644 (file)
@@ -15,6 +15,8 @@ const int LDAPConnection::SEARCH_BASE = LDAPAsynConnection::SEARCH_BASE;
 const int LDAPConnection::SEARCH_ONE = LDAPAsynConnection::SEARCH_ONE;
 const int LDAPConnection::SEARCH_SUB = LDAPAsynConnection::SEARCH_SUB;
 
+using namespace std;
+
 LDAPConnection::LDAPConnection(const string& hostname, int port, 
         LDAPConstraints* cons) :
         LDAPAsynConnection(hostname, port, cons){
@@ -22,6 +24,10 @@ LDAPConnection::LDAPConnection(const string& hostname, int port,
 
 LDAPConnection::~LDAPConnection(){
 }
+
+int LDAPConnection::start_tls(){
+    return LDAPAsynConnection::start_tls();
+}
    
 void LDAPConnection::bind(const string& dn, const string& passwd,
         LDAPConstraints* cons){
@@ -50,6 +56,7 @@ void LDAPConnection::bind(const string& dn, const string& passwd,
         }
     }
     delete res;
+    delete msg;   // memcheck
 }
 
 void LDAPConnection::unbind(){
@@ -243,11 +250,12 @@ LDAPSearchResults* LDAPConnection::search(const string& base, int scope,
     LDAPSearchResults* results= 0;
     
     try{
+        results = new LDAPSearchResults();
         msgq = LDAPAsynConnection::search(base,scope, filter, attrs, attrsOnly,
                 cons);
-        results = new LDAPSearchResults();
         res = results->readMessageQueue(msgq);
     }catch(LDAPException e){
+        delete results; // memcheck
         delete msgq;
         throw;
     }
@@ -262,12 +270,14 @@ LDAPSearchResults* LDAPConnection::search(const string& base, int scope,
             case LDAPResult::REFERRAL :
             {
                 LDAPUrlList urls = res->getReferralUrls();
+                delete results; // memcheck
                 delete res;
                 delete msgq;
                 throw LDAPReferralException(urls);
             }
             break;
             default :
+                delete results; // memcheck
                 delete res;
                 delete msgq;
                 throw LDAPException(resCode);
@@ -324,3 +334,26 @@ 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();
+}
+