2008-03-28 07:05:10 -04:00
|
|
|
// $OpenLDAP$
|
2000-10-03 14:50:44 -04:00
|
|
|
/*
|
2015-02-11 16:36:57 -05:00
|
|
|
* Copyright 2000-2015 The OpenLDAP Foundation, All Rights Reserved.
|
2000-10-03 14:50:44 -04:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
#include <lber.h>
|
|
|
|
|
#include "LDAPRequest.h"
|
|
|
|
|
#include "LDAPException.h"
|
|
|
|
|
|
|
|
|
|
#include "LDAPResult.h"
|
|
|
|
|
#include "LDAPExtResult.h"
|
|
|
|
|
|
2001-09-28 12:39:58 -04:00
|
|
|
using namespace std;
|
|
|
|
|
|
2000-10-03 14:50:44 -04:00
|
|
|
LDAPExtResult::LDAPExtResult(const LDAPRequest* req, LDAPMessage* msg) :
|
|
|
|
|
LDAPResult(req, msg){
|
|
|
|
|
DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPExtResult::LDAPExtResult()" << endl);
|
|
|
|
|
char* oid = 0;
|
|
|
|
|
BerValue* data = 0;
|
|
|
|
|
LDAP* lc = req->getConnection()->getSessionHandle();
|
|
|
|
|
int err=ldap_parse_extended_result(lc, msg, &oid, &data, 0);
|
|
|
|
|
if(err != LDAP_SUCCESS){
|
|
|
|
|
ber_bvfree(data);
|
|
|
|
|
ldap_memfree(oid);
|
|
|
|
|
throw LDAPException(err);
|
|
|
|
|
}else{
|
|
|
|
|
m_oid=string(oid);
|
|
|
|
|
ldap_memfree(oid);
|
|
|
|
|
if(data){
|
|
|
|
|
m_data=string(data->bv_val, data->bv_len);
|
|
|
|
|
ber_bvfree(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LDAPExtResult::~LDAPExtResult(){
|
|
|
|
|
DEBUG(LDAP_DEBUG_DESTROY,"LDAPExtResult::~LDAPExtResult()" << endl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const string& LDAPExtResult::getResponseOid() const{
|
|
|
|
|
return m_oid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const string& LDAPExtResult::getResponse() const{
|
|
|
|
|
return m_data;
|
|
|
|
|
}
|
|
|
|
|
|