From 5ea77a75dd2d2158401331879f3c8f47940a732c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:35:32 +0200 Subject: Adding upstream version 2.5.13+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..d82348c --- /dev/null +++ b/contrib/ldapc++/src/LDAPSearchReference.cpp @@ -0,0 +1,53 @@ +// $OpenLDAP$ +/* + * Copyright 2000-2022 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