]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPRequest.cpp
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LDAPRequest.cpp
index bc42175b60d2213822f602baa3a9df77f3bb087f..3d3bd3bb7fbfd991936388511c2d0f160ccbc843 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -7,6 +8,8 @@
 #include "debug.h"
 #include "LDAPRequest.h"
 
+using namespace std;
+
 LDAPRequest::LDAPRequest(){
     DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest()" << endl);
 }
@@ -45,6 +48,36 @@ LDAPRequest::~LDAPRequest(){
     delete m_cons;
 }
 
+LDAPMsg* LDAPRequest::getNextMessage() const 
+{
+    DEBUG(LDAP_DEBUG_DESTROY,"LDAPRequest::getNextMessage()" << endl);
+    int res;
+    LDAPMessage *msg;
+
+    res=ldap_result(this->m_connection->getSessionHandle(),
+            this->m_msgID,0,0,&msg);
+
+    if (res <= 0){
+        if(msg != 0){
+            ldap_msgfree(msg);
+        }
+        throw  LDAPException(this->m_connection);
+    }else{     
+        LDAPMsg *ret=0;
+        //this can  throw an exception (Decoding Error)
+        ret = LDAPMsg::create(this,msg);
+        ldap_msgfree(msg);
+        return ret;
+    }
+}
+
+LDAPRequest* LDAPRequest::followReferral(LDAPMsg* /*urls*/){
+    DEBUG(LDAP_DEBUG_TRACE,"LDAPBindRequest::followReferral()" << endl);
+    DEBUG(LDAP_DEBUG_TRACE,
+            "ReferralChasing not implemented for this operation" << endl);
+    return 0;
+}
+
 const LDAPConstraints* LDAPRequest::getConstraints() const{
     DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConstraints()" << endl);
     return m_cons;