#include "LDAPUrlList.h"
#include "LDAPException.h"
+using namespace std;
+
// TODO: How to handle unsolicited notifications, like notice of
// disconnection
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)
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);
}
break;
}
- }
+ }
}
// TODO Maybe moved to LDAPRequest::followReferral seems more reasonable
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);
}