]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPMessageQueue.cpp
Entry rwlock is no longer needed as concurrency is managed
[openldap] / contrib / ldapc++ / src / LDAPMessageQueue.cpp
index dd3b12eeb9832b820de426fecef198567530e632..2668609e8768d861a28bf41d412e556ea23c97bd 100644 (file)
@@ -18,6 +18,8 @@
 #include "LDAPUrlList.h"
 #include "LDAPException.h"
 
+using namespace std;
+
 // TODO: How to handle unsolicited notifications, like notice of
 //       disconnection
 
@@ -39,18 +41,18 @@ LDAPMessageQueue::~LDAPMessageQueue(){
 
 LDAPMsg *LDAPMessageQueue::getNext(){
     DEBUG(LDAP_DEBUG_TRACE,"LDAPMessageQueue::getNext()" << endl);
-       LDAPMessage *msg;
+    LDAPMessage *msg;
     LDAPRequest *req=m_activeReq.top();
     int msg_id = req->getMsgID();
-       int res;
+    int res;
     const  LDAPAsynConnection *con=req->getConnection();
     res=ldap_result(con->getSessionHandle(),msg_id,0,0,&msg);
     if (res <= 0){
         if(msg != 0){
             ldap_msgfree(msg);
         }
-               throw  LDAPException(con);
-       }else{  
+       throw  LDAPException(con);
+    }else{     
         const LDAPConstraints *constr=req->getConstraints();
         LDAPMsg *ret=0;
         //this can  throw an exception (Decoding Error)
@@ -123,9 +125,6 @@ LDAPMsg *LDAPMessageQueue::getNext(){
                 LDAPResult* res_p=(LDAPResult*)ret;
                 switch (res_p->getResultCode()) {
                     case LDAPResult::REFERRAL :
-                        DEBUG(LDAP_DEBUG_TRACE, 
-                               "referral chasing to be implemented" 
-                                << endl);
                         if(constr->getReferralChase()){
                             //throws Exception (limit Exceeded)
                             LDAPRequest *refReq=chaseReferral(ret);
@@ -145,7 +144,7 @@ LDAPMsg *LDAPMessageQueue::getNext(){
                 }
             break;
         }
-       }       
+    }  
 }
 
 // TODO Maybe moved to LDAPRequest::followReferral seems more reasonable
@@ -156,8 +155,6 @@ LDAPRequest* LDAPMessageQueue::chaseReferral(LDAPMsg* ref){
     LDAPRequest *refReq=req->followReferral(ref);
     if(refReq !=0){
         if(refReq->getConstraints()->getHopLimit() < refReq->getHopCount()){
-            cout << "LIMIT:" << refReq->getConstraints()->getHopLimit() 
-                << "  COUNT:" << refReq->getHopCount() << endl;
             delete(refReq);
             throw LDAPException(LDAP_REFERRAL_LIMIT_EXCEEDED);
         }