3 * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include "LDAPSearchReference.h"
12 #include "LDAPException.h"
13 #include "LDAPRequest.h"
18 LDAPSearchReference::LDAPSearchReference(const LDAPRequest *req,
19 LDAPMessage *msg) : LDAPMsg(msg){
20 DEBUG(LDAP_DEBUG_CONSTRUCT,
21 "LDAPSearchReference::LDAPSearchReference()" << endl;)
23 LDAPControl** srvctrls=0;
24 const LDAPAsynConnection* con=req->getConnection();
25 int err = ldap_parse_reference(con->getSessionHandle(), msg, &ref,
27 if (err != LDAP_SUCCESS){
28 ber_memvfree((void**) ref);
29 ldap_controls_free(srvctrls);
30 throw LDAPException(err);
32 m_urlList=LDAPUrlList(ref);
33 ber_memvfree((void**) ref);
35 m_srvControls = LDAPControlSet(srvctrls);
37 ldap_controls_free(srvctrls);
39 m_hasControls = false;
44 LDAPSearchReference::~LDAPSearchReference(){
45 DEBUG(LDAP_DEBUG_DESTROY,"LDAPSearchReference::~LDAPSearchReference()"
49 const LDAPUrlList& LDAPSearchReference::getUrls() const{
50 DEBUG(LDAP_DEBUG_TRACE,"LDAPSearchReference::getUrls()" << endl);