From 7731832751ab9f3c6ddeb66f186d3d7fa1934a6d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 13:11:40 +0200 Subject: Adding upstream version 2.4.57+dfsg. Signed-off-by: Daniel Baumann --- contrib/ldapc++/src/LDAPSearchReference.cpp | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 contrib/ldapc++/src/LDAPSearchReference.cpp (limited to 'contrib/ldapc++/src/LDAPSearchReference.cpp') diff --git a/contrib/ldapc++/src/LDAPSearchReference.cpp b/contrib/ldapc++/src/LDAPSearchReference.cpp new file mode 100644 index 0000000..47ed70d --- /dev/null +++ b/contrib/ldapc++/src/LDAPSearchReference.cpp @@ -0,0 +1,53 @@ +// $OpenLDAP$ +/* + * Copyright 2000-2021 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + + +#include + +#include "debug.h" +#include "LDAPSearchReference.h" +#include "LDAPException.h" +#include "LDAPRequest.h" +#include "LDAPUrl.h" + +using namespace std; + +LDAPSearchReference::LDAPSearchReference(const LDAPRequest *req, + LDAPMessage *msg) : LDAPMsg(msg){ + DEBUG(LDAP_DEBUG_CONSTRUCT, + "LDAPSearchReference::LDAPSearchReference()" << endl;) + char **ref=0; + LDAPControl** srvctrls=0; + const LDAPAsynConnection* con=req->getConnection(); + int err = ldap_parse_reference(con->getSessionHandle(), msg, &ref, + &srvctrls,0); + if (err != LDAP_SUCCESS){ + ber_memvfree((void**) ref); + ldap_controls_free(srvctrls); + throw LDAPException(err); + }else{ + m_urlList=LDAPUrlList(ref); + ber_memvfree((void**) ref); + if (srvctrls){ + m_srvControls = LDAPControlSet(srvctrls); + m_hasControls = true; + ldap_controls_free(srvctrls); + }else{ + m_hasControls = false; + } + } +} + +LDAPSearchReference::~LDAPSearchReference(){ + DEBUG(LDAP_DEBUG_DESTROY,"LDAPSearchReference::~LDAPSearchReference()" + << endl); +} + +const LDAPUrlList& LDAPSearchReference::getUrls() const{ + DEBUG(LDAP_DEBUG_TRACE,"LDAPSearchReference::getUrls()" << endl); + return m_urlList; +} + -- cgit v1.2.3