[bugs:#2648] Remove Large Volume Support from SFCC
diff --git a/README b/README
index db45ccc..bc51fd7 100644
--- a/README
+++ b/README
@@ -123,8 +123,7 @@
will require a re-linking of your application.
B. Feature Freeze
-The version 1 sfcc API is frozen: new features like support for large
-volume results via iterator won't be backported.
+The version 1 sfcc API is frozen: new features won't be backported.
Backend Selection:
@@ -175,25 +174,6 @@
- cmpi-tests (currently available
-Large Volume Data support - CIMXML :
- The default is to build without this support.
- To build with this support :
-
- #configure --enable-large_volume_support
- #make
- #make install
-
- Large volume support is provided for the following requests :
- enumerateClasses
- enumerateClassNames
- enumerateInstances
- enumerateInstanceNames
-
- This support will create multiple threads to receive data from the server and
- to parse the data as it is received. This creates parallel operation of receiving
- data and parsing it.
-
-
Functions:
==========
diff --git a/backend/cimxml/cimXmlParser.c b/backend/cimxml/cimXmlParser.c
index 128d92f..d1c312f 100644
--- a/backend/cimxml/cimXmlParser.c
+++ b/backend/cimxml/cimXmlParser.c
@@ -34,53 +34,6 @@
#include <pthread.h>
-#ifdef LARGE_VOL_SUPPORT
-
-// New begin
-#include <curl/curl.h> // new
-#include <time.h> // new
-#include <sys/time.h> // new
-#include <setjmp.h> // new
-
-struct _CMCIConnectionFT; // new
-typedef struct _CMCIConnectionFT CMCIConnectionFT; // new
-
-char * getNextSection(struct _CMCIConnection * ) ;
-int checkTag(char * , int ) ;
-
-#include "cmci.h"
-#include "utilStringBuffer.h" // new
-#include "cimXmlParser.h" // new
-#include "native.h" // new
-#include "esinfo.h" // new
-#include "conn.h" // new
-
-jmp_buf save_env ;
-
-/*
- * response data helper functions.
- */
-inline char * CURPTR (enumScanInfo * esi ){
- return(((char*)(esi->base)) + (esi->curoff)) ;
-}
-inline char * SSECPTR (enumScanInfo * esi ){
- return(((char*)(esi->base)) + (esi->ssecoff)) ;
-}
-inline char * LASTPTR (enumScanInfo * esi ){
- return(((char*)(esi->base)) + (esi->eodoff)) ;
-}
-inline void INCOFF (enumScanInfo * esi ){
- (esi->curoff)++ ;
-}
-
-int sfccFreeSection(ParserControl * );
-void * enumScanThrd(struct native_enum *);
-int sfccLex(parseUnion * , ParserControl * );
-char * getNextSection(struct _CMCIConnection * );
-int checkTag(char * , int );
-
-#endif /* endif LARGE_VOL_SUPPORT */
-
static int attrsOk(XmlBuffer * xb, const XmlElement * e, XmlAttr * r,
const char *tag, int etag);
static char *getValue(XmlBuffer * xb, const char *v);
@@ -1319,8 +1272,6 @@
};
#define TAGS_NITEMS (int)(sizeof(tags)/sizeof(Tags))
-#ifndef LARGE_VOL_SUPPORT
-
int sfccLex(parseUnion * lvalp, ParserControl * parm)
{
int i, rc;
@@ -1363,7 +1314,6 @@
}
return 0;
}
-#endif
static pthread_mutex_t scan_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -1486,349 +1436,5 @@
}
}
-#if LARGE_VOL_SUPPORT
-/* **************************************************************************/
-/* **************************************************************************/
-/* **************************************************************************/
-/* **************************************************************************/
-/* **************************************************************************/
-/* **************************************************************************/
-/* **************************************************************************/
-int sfccFreeSection(ParserControl * parm)
-{
- if(parm->econ->asynRCntl.escanInfo.section){
- free(parm->econ->asynRCntl.escanInfo.section) ;
- parm->econ->asynRCntl.escanInfo.section = NULL ;
- }
-}
-#define TIMEDELAY 10
-void * enumScanThrd(struct native_enum *NatEnum)
-{
- CMCIConnection * con = NatEnum->econ ; /* enumeration */
- CMPIObjectPath * cop = NatEnum->ecop ; /* enumeration */
-
- struct timespec tp ;
- int rc = 0 ;
-
- ParserControl control;
- struct native_enum *local_enmp ;
-
- memset(&control,0,sizeof(control));
-
- /*
- * get the data array and save a copy of address in enumeration
- */
-
- XmlBuffer *xmb = newXmlBuffer(NULL);
- control.xmb = xmb;
- control.respHdr.xmlBuffer = xmb;
-
- control.respHdr.rvArray=newCMPIArray(0,0,NULL);
-
- local_enmp = con->asynRCntl.enmp ;
-
- local_enmp->data = control.respHdr.rvArray ;
-
- control.requestObjectPath = cop;
-
- control.heap = parser_heap_init();
-
- control.econ = con ;
-
- if(rc = setjmp(save_env)) {
- printf(" we had a timeout , we are going to exit from here \n") ;
- con->asynRCntl.escanInfo.parsestate = PARSTATE_SERVER_TIMEOUT ;
- con->asynRCntl.xfer_state = XFER_ERROR ;
- return ;
- }
-
- /*
- * wait for first data block received or xfer complete
- * we need to have some data before starting
- */
- while((con->asynRCntl.xfer_state != XFER_DATA_RECVD )&&
- (con->asynRCntl.xfer_state != XFER_COMPLETE)){
- usleep(100000) ;
- }
-
- control.respHdr.rc = startParsing(&control);
-
- /*
- * releaseXmlBuffer free's that last con->asynRCntl.escanInfo.section
- * we clear out that pointer just to be safe
- */
- releaseXmlBuffer(xmb);
-
- con->asynRCntl.escanInfo.section = 0 ;
-
- parser_heap_term(control.heap);
-
- con->asynRCntl.escanInfo.parsestate = PARSTATE_COMPLETE ;
-
-}
-
-int sfccLex(parseUnion * lvalp, ParserControl * parm)
-{
- int i, rc;
- char *next;
- char *nextSection ;
-
- for (;;) {
-
- if(parm->econ) {
-
- if(parm->econ->asynRCntl.escanInfo.getnew == 1 ){
-
- nextSection = getNextSection(parm->econ) ;
- if(nextSection != NULL) {
- parm->xmb->base = nextSection ;
- parm->xmb->cur = nextSection ;
- parm->xmb->last = nextSection + (parm->econ->asynRCntl.escanInfo.sectlen) ;
-
- } else {
- printf(" sfccLex --- section is NULL !!!!!!!!!!!!!!!!! \n") ;
- }
- }
- }
-
-
- next = nextTag(parm->xmb);
- if (next == NULL) {
- return 0;
- }
-// fprintf(stderr,"--- token: %.32s\n",next); //usefull for debugging
- if (parm->xmb->eTagFound) {
- parm->xmb->eTagFound = 0;
- return parm->xmb->etag;
- }
-
- if (*next == '/') {
- for (i = 0; i < TAGS_NITEMS; i++) {
- if (nextEquals(next + 1, tags[i].tag, tags[i].tagLen) == 1) {
- skipTag(parm->xmb);
- return tags[i].etag;
- }
- }
- }
-
- else {
- if (strncmp(parm->xmb->cur, "<!--", 4) == 0) {
- parm->xmb->cur = strstr(parm->xmb->cur, "-->") + 3;
- continue;
- } else
- if (strncmp(parm->xmb->cur, "<EC>", 4) == 0) {
- parm->econ->asynRCntl.escanInfo.getnew = 1 ;
- parm->econ->asynRCntl.escanInfo.parsestate = PARSTATE_STARTED ;
- continue;
- }
- for (i = 0; i < TAGS_NITEMS; i++) {
- if (nextEquals(next, tags[i].tag, tags[i].tagLen) == 1) {
-// printf("+++ %d\n",i);
- rc=tags[i].process(lvalp, parm);
- return rc;
- }
- }
- }
- break;
- }
- return 0;
-}
-
-char * getNextSection(struct _CMCIConnection * con)
-{
- char * xmlb = NULL;
- char * workptr = NULL;
- char * curptr = NULL;
- int xmlblen = 0;
- int tagval = 0;
- int retcode = 0;
- int toval = 0;
-
- /*
- * free that old buffer
- */
-
- if(con->asynRCntl.escanInfo.section != NULL) {
- free(con->asynRCntl.escanInfo.section);
- con->asynRCntl.escanInfo.section = NULL ;
- }
-
- if((retcode = pthread_mutex_lock(&(con->asynRCntl.escanlock))) != 0){
- printf(" getNextSection pthread lock return code %d\n",retcode) ;
- }
-
- /*
- * If we have no more new data from the server , we
- * unlock and sleep then check till we see that we have
- * received new data
- */
-
- while(con->asynRCntl.escanInfo.prevtotl == con->asynRCntl.escanInfo.recdtotl){
- if((retcode = pthread_mutex_unlock(&(con->asynRCntl.escanlock))) != 0){
- printf(" getNextSection pthread lock return code %d\n",retcode) ;
- }
- /* *******************************************
- * *******************************************
- * timeout toval keeps us from hanging forever
- * *******************************************
- * *******************************************
- */
- usleep(1000) ;
- toval++ ;
-
- if(toval>5000)
- longjmp (save_env, 1);
-
- if(con->asynRCntl.escanInfo.prevtotl != con->asynRCntl.escanInfo.recdtotl){
- /*
- * we got more data , exit this loop
- */
- if((retcode = pthread_mutex_lock(&(con->asynRCntl.escanlock))) != 0){
- printf(" getNextSection pthread lock return code %d\n",retcode) ;
- }
- break;
- }
- }
-
- if((con->asynRCntl.xfer_state == XFER_DATA_RECVD) ||
- (con->asynRCntl.xfer_state == XFER_COMPLETE) ) {
-
- workptr = LASTPTR(&(con->asynRCntl.escanInfo)) ;
- curptr = CURPTR(&(con->asynRCntl.escanInfo));
-
- con->asynRCntl.escanInfo.ssecoff = con->asynRCntl.escanInfo.curoff ;
-
- toval = 0;
- while(workptr > curptr) {
- if(*workptr == '>'){
- tagval = checkTag(workptr , con->asynRCntl.eMethodType) ;
- if(tagval == 0){
- con->asynRCntl.escanInfo.curoff = con->asynRCntl.escanInfo.curoff + (workptr - curptr) + 1 ;
- xmlblen = ((workptr - curptr) + 5) ;
-
- xmlb = malloc(xmlblen + 64) ;
- con->asynRCntl.escanInfo.section = xmlb ;
-
- con->asynRCntl.escanInfo.sectlen = xmlblen + 5 ;
- memset(xmlb , 0x0cc , xmlblen + 5) ;
-
- if(xmlb != NULL){
- memcpy(xmlb , SSECPTR(&con->asynRCntl.escanInfo) , xmlblen) ;
- strcpy((xmlb+(xmlblen - 4)) , "<EC>") ;
- con->asynRCntl.escanInfo.getnew = 0 ;
-
- } else {
- /* getNextSection xmlb is NULL !!! This is bad */
- }
-
- con->asynRCntl.escanInfo.prevtotl = con->asynRCntl.escanInfo.recdtotl ;
-
- if((retcode = pthread_mutex_unlock(&(con->asynRCntl.escanlock))) != 0){
- printf(" getNextSection pthread lock return code %d\n",retcode) ;
- }
- return(xmlb) ;
- } else {
- /*
- * backup before this tag
- */
- workptr = workptr - tagval ;
- if(workptr <= curptr){
- if (con->asynRCntl.escanInfo.prevtotl != con->asynRCntl.escanInfo.recdtotl){
- pthread_mutex_unlock(&(con->asynRCntl.escanlock));
- usleep(1000) ;
- toval++ ;
- if(toval > 5000)
- longjmp (save_env, 2);
- pthread_mutex_lock(&(con->asynRCntl.escanlock));
- workptr = LASTPTR(&(con->asynRCntl.escanInfo)) ;
- curptr = CURPTR(&(con->asynRCntl.escanInfo));
- }
- }
- continue;
- }
- } else {
- workptr-- ;
- if(workptr <= curptr){
- if (con->asynRCntl.escanInfo.prevtotl != con->asynRCntl.escanInfo.recdtotl){
- workptr = LASTPTR(&(con->asynRCntl.escanInfo)) ;
- curptr = CURPTR(&(con->asynRCntl.escanInfo));
- }
- }
- }
- }
- }
-
- if((retcode = pthread_mutex_unlock(&(con->asynRCntl.escanlock))) != 0){
- printf(" getNextSection pthread unlock return code %d\n",retcode) ;
- }
- return(NULL) ;
-}
-/*
- * check to see if the ending tag is at a
- * place in the data that we can use to
- * start parsing. The parsing needs to be
- * given certain chunks of the data based on
- * the request we are processing.
- * If we see </CIM> thats good , we are
- * at the end of the data.
- * return 0 if ending tag is OK
- * return >0 if ending tag is not OK
- * CIM
- * VALUE.NAMEDINSTANCE
- * CLASSNAME
- *
- */
-
-int checkTag(char * wrkptr , int methodtype ) {
-char * workptr = wrkptr ;
-char temptag[120] ;
-int taglength = 1 ;
-
- memset(&temptag[0] , 00 , 119) ;
- /*
- * find start of tag
- */
- while(*workptr != '<'){
- workptr-- ;
- taglength++ ;
- }
-
-
- if (strncmp(workptr , "</CIM>", 6) == 0) {
- return(0) ;
- }
-
- switch(methodtype) {
- case ENUMERATEINSTANCES:
- if (strncmp(workptr , "</VALUE.NAMEDINSTANCE>", 22) == 0) {
- return(0) ;
- }
- break ;
- case ENUMERATEINSTANCENAMES:
- if (strncmp(workptr , "</INSTANCENAME>", 15) == 0) {
- return(0) ;
- }
- break;
- case ENUMERATECLASSES:
- if (strncmp(workptr , "</CLASS>", 8) == 0) {
- return(0) ;
- }
- break;
- case ENUMERATECLASSNAMES:
- if (strncmp(workptr , "<CLASSNAME ", 11) == 0) {
- return(0) ;
- }
- break;
- }
-
- /*
- * return the length of this tag
- */
- strncpy(&temptag[0] , workptr , taglength) ;
- return(taglength) ;
-
-}
-
-#endif
diff --git a/backend/cimxml/cimXmlParser.h b/backend/cimxml/cimXmlParser.h
index f34d36b..d54f4ac 100644
--- a/backend/cimxml/cimXmlParser.h
+++ b/backend/cimxml/cimXmlParser.h
@@ -428,9 +428,6 @@
ResponseHdr respHdr;
CMPIObjectPath *requestObjectPath;
ParserHeap *heap;
-#ifdef LARGE_VOL_SUPPORT
- CMCIConnection * econ ; /* enumeration connection */
-#endif
} ParserControl;
diff --git a/backend/cimxml/client.c b/backend/cimxml/client.c
index 16b788d..e076544 100644
--- a/backend/cimxml/client.c
+++ b/backend/cimxml/client.c
@@ -38,7 +38,6 @@
#include "cimc.h"
#include "nativeCimXml.h"
-#ifndef LARGE_VOL_SUPPORT
typedef const struct _CMCIConnectionFT {
CMPIStatus (*release) (CMCIConnection *);
char *(*genRequest)(ClientEnc *cle, const char *op, CMPIObjectPath *cop,
@@ -48,49 +47,6 @@
void (*initializeHeaders)(CMCIConnection *con);
void (*reset)(CMCIConnection *);
} CMCIConnectionFT;
-#else
-
-#include "esinfo.h"
-#define TIMEDELAY 10
-void * enumScanThrd(struct native_enum *) ;
-
-static CMPIEnumeration * enumInstances(CMCIClient * ,
- CMPIObjectPath *,
- CMPIFlags ,
- char ** ,
- CMPIStatus * );
-static CMPIEnumeration * enumInstanceNames(CMCIClient * ,
- CMPIObjectPath * ,
- CMPIStatus * ) ;
-static CMPIEnumeration * enumClasses(CMCIClient * ,
- CMPIObjectPath * ,
- CMPIFlags ,
- CMPIStatus * ) ;
-static CMPIEnumeration* enumClassNames(CMCIClient * ,
- CMPIObjectPath * ,
- CMPIFlags ,
- CMPIStatus *);
-static char* genEnumRequest(ClientEnc * , const char * , CMPIObjectPath * , int ) ;
-char *getEnumResponse(CMCIConnection * , CMPIObjectPath *) ;
-static size_t enumWriteHeaders(void *, size_t , size_t , void *);
-static size_t enumWriteCb(void *, size_t , size_t , void *) ;
-void initEscanInfo(CMCIConnection * ) ;
-static int enumCheckProgress(void * , double , double , double , double );
-
-typedef const struct _CMCIConnectionFT {
- CMPIStatus (*release) (CMCIConnection *);
- char *(*genRequest)(ClientEnc *cle, const char *op, CMPIObjectPath *cop,
- int classWithKeys);
- char *(*genEnumRequest)(ClientEnc *cle, const char *op, CMPIObjectPath *cop,
- int classWithKeys);
- char *(*addPayload)(CMCIConnection *, UtilStringBuffer *pl);
- char *(*getResponse)(CMCIConnection *con, CMPIObjectPath *cop);
- char *(*getEnumResponse)(CMCIConnection *con, CMPIObjectPath *cop);
- void (*initializeHeaders)(CMCIConnection *con);
- void (*reset)(CMCIConnection *);
-} CMCIConnectionFT;
-
-#endif /* endif LARGE_VOL_SUPPORT */
#include "conn.h"
@@ -139,13 +95,6 @@
#else
#define SET_DEBUG()
#endif
-/*
- * for large volume data http transfer encoding chunked
- */
-
-pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t init_cond = PTHREAD_COND_INITIALIZER;
-
//#if TIMING
#if 0
@@ -560,7 +509,6 @@
for (i = 0; headers[i]!= NULL; i++)
con->mHeaders = curl_slist_append(con->mHeaders, headers[i]);
}
-#ifndef LARGE_VOL_SUPPORT
static CMCIConnectionFT conFt={
releaseConnection,
genRequest,
@@ -568,17 +516,6 @@
getResponse,
initializeHeaders
};
-#else
-static CMCIConnectionFT conFt={
- releaseConnection,
- genRequest,
- genEnumRequest,
- addPayload,
- getResponse,
- getEnumResponse,
- initializeHeaders
-};
-#endif
/* --------------------------------------------------------------------------*/
@@ -1058,8 +995,6 @@
return rc;
}
-#ifndef LARGE_VOL_SUPPORT
-
/* --------------------------------------------------------------------------*/
static CMPIEnumeration * enumInstanceNames(
CMCIClient * mb,
@@ -1129,7 +1064,6 @@
END_TIMING(_T_GOOD);
return retval;
}
-#endif
/* --------------------------------------------------------------------------*/
@@ -1650,8 +1584,6 @@
return retval;
}
-#ifndef LARGE_VOL_SUPPORT
-
/* --------------------------------------------------------------------------*/
static CMPIEnumeration * enumInstances(
CMCIClient * mb,
@@ -1731,7 +1663,6 @@
END_TIMING(_T_GOOD);
return retval;
}
-#endif
/* --------------------------------------------------------------------------*/
static CMPIEnumeration * associators(
@@ -2720,8 +2651,6 @@
return ccc;
}
-#ifndef LARGE_VOL_SUPPORT
-
/* --------------------------------------------------------------------------*/
/* finished & working */
@@ -2873,7 +2802,6 @@
return retval;
}
-#endif
static CMCIClientFT clientFt = {
NATIVE_FT_VERSION,
@@ -3054,803 +2982,3 @@
return env;
}
-/* *********************************************************** */
-/* *********************************************************** */
-/* */
-/* *********************************************************** */
-/* *********************************************************** */
-
-#ifdef LARGE_VOL_SUPPORT
-
-
-/* --------------------------------------------------------------------------*/
-
-/* --------------------------------------------------------------------------*/
-static CMPIEnumeration * enumInstances(
- CMCIClient * mb,
- CMPIObjectPath * cop,
- CMPIFlags flags,
- char ** properties,
- CMPIStatus * rc)
-{
- ClientEnc *cl = (ClientEnc *)mb;
- CMCIConnection *con = cl->connection;
- UtilStringBuffer *sb = UtilFactory->newStringBuffer(2048);
- char *error;
- CMPIEnumeration *retEnum;
- struct native_enum *retNatEnum;
- pthread_t enum_scanthrd_id = 0 ;
- int pthrd_error = 0 ;
-
- initEscanInfo(con) ;
-
- START_TIMING(EnumerateInstances);
- SET_DEBUG();
-
- if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- con->ft->genEnumRequest(cl, EnumerateInstances, cop, 0);
-
- addXmlHeader(sb);
-
- sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateInstances, "\">");
- addXmlNamespace(sb, cop);
-
- addXmlClassnameParam(sb, cop);
-
- emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
- emitlocal(sb,flags & CMPI_FLAG_LocalOnly);
- emitqual(sb,flags & CMPI_FLAG_IncludeQualifiers);
- emitorigin(sb,flags & CMPI_FLAG_IncludeClassOrigin);
-
- if (properties != NULL)
- addXmlPropertyListParam(sb, properties);
-
- sb->ft->appendChars(sb,"</IMETHODCALL>\n");
- addXmlFooter(sb);
-
- error = con->ft->addPayload(con,sb);
-
- CMSetStatus (&con->mStatus, CMPI_RC_OK );
-
- if (error || (error = con->ft->getEnumResponse(con, cop))) {
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
- free(error);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- if (con->mStatus.rc != CMPI_RC_OK) {
- if (rc)
- *rc=cloneStatus(con->mStatus);
- CMRelease(sb);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- /*
- * allocate an empty enumeration , to be filled in
- * by the scan of the xml data in enumScanThrd .
- */
-
- retEnum = newCMPIEnumeration(NULL , NULL);
-
- /*
- * copy addresses so parsing can find our connection and
- * the enumeration.
- */
-
- retNatEnum = (struct native_enum *) retEnum ;
- retNatEnum->econ = con ;
- retNatEnum->ecop = cop ;
- con->asynRCntl.enmp = (struct native_enum *) retEnum ;
-
- pthrd_error = pthread_create(&enum_scanthrd_id,
- NULL,
- (void*)&enumScanThrd,
- (void*)retNatEnum);
- /*
- * if enumInstances Couldn't run thread pthrd_error , system error
- * otherwise we are OK , set status appropriately
- */
- if(pthrd_error != 0){
- CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
- } else {
- CMSetStatus(rc,CMPI_RC_OK);
- }
-
- CMRelease(sb);
-
- return retEnum;
-}
-
-/* --------------------------------------------------------------------------*/
-static CMPIEnumeration * enumInstanceNames(
- CMCIClient * mb,
- CMPIObjectPath * cop,
- CMPIStatus * rc)
-{
- ClientEnc * cl = (ClientEnc*)mb;
- CMCIConnection * con = cl->connection;
- UtilStringBuffer * sb = UtilFactory->newStringBuffer(2048);
- char * error;
- CMPIEnumeration *retval;
- CMPIEnumeration *retEnum;
- struct native_enum *retNatEnum;
- pthread_t enum_scanthrd_id = 0 ;
- int pthrd_error = 0 ;
-
- initEscanInfo(con) ;
-
- START_TIMING(EnumerateInstanceNames);
- SET_DEBUG();
-
- if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- con->ft->genEnumRequest(cl, EnumerateInstanceNames, cop, 0);
-
- /* Construct the CIM-XML request */
- addXmlHeader(sb);
- sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateInstanceNames, "\">");
-
- addXmlNamespace(sb, cop);
- addXmlClassnameParam(sb, cop);
-
- sb->ft->appendChars(sb,"</IMETHODCALL>\n");
- addXmlFooter(sb);
-
- error = con->ft->addPayload(con, sb);
-
- CMSetStatus (&con->mStatus, CMPI_RC_OK );
-
- if (error || (error = con->ft->getEnumResponse(con, cop))) {
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
- free(error);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- if (con->mStatus.rc != CMPI_RC_OK) {
- if (rc)
- *rc=cloneStatus(con->mStatus);
- CMRelease(sb);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- /*
- * allocate an empty enumeration , to be filled in
- * by the scan of the xml data in enumScanThrd .
- */
-
- retEnum = newCMPIEnumeration(NULL , NULL);
-
- /*
- * copy addresses so parsing can find our connection and
- * the enumeration.
- */
-
- retNatEnum = (struct native_enum *) retEnum ;
- retNatEnum->econ = con ;
- retNatEnum->ecop = cop ;
- con->asynRCntl.enmp = (struct native_enum *) retEnum ;
-
- pthrd_error = pthread_create(&enum_scanthrd_id,
- NULL,
- (void*)&enumScanThrd,
- (void*)retNatEnum);
- /*
- * if enumInstanceNames Couldn't run thread pthrd_error , system error
- * otherwise we are OK , set status appropriately
- */
- if(pthrd_error != 0){
- CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
- } else {
- CMSetStatus(rc,CMPI_RC_OK);
- }
-
- CMRelease(sb);
-
- return retEnum;
-
-}
-/* --------------------------------------------------------------------------*/
-static CMPIEnumeration * enumClasses(
- CMCIClient * mb,
- CMPIObjectPath * cop,
- CMPIFlags flags,
- CMPIStatus * rc)
-{
- ClientEnc *cl = (ClientEnc *)mb;
- CMCIConnection *con = cl->connection;
- UtilStringBuffer *sb = UtilFactory->newStringBuffer(2048);
- char *error;
- CMPIEnumeration *retval;
- CMPIEnumeration *retEnum;
- struct native_enum *retNatEnum;
- pthread_t enum_scanthrd_id = 0 ;
- int pthrd_error = 0 ;
-
- START_TIMING(EnumerateClasses);
- SET_DEBUG();
-
- initEscanInfo(con) ;
- if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- con->ft->genEnumRequest(cl, EnumerateClasses, cop, 0);
-
- /* Construct the CIM-XML request */
- addXmlHeader(sb);
- sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateClasses, "\">");
-
- addXmlNamespace(sb, cop);
- emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
- emitlocal(sb,flags & CMPI_FLAG_LocalOnly);
- emitqual(sb,flags & CMPI_FLAG_IncludeQualifiers);
- emitorigin(sb,flags & CMPI_FLAG_IncludeClassOrigin);
- addXmlClassnameParam(sb, cop);
-
- sb->ft->appendChars(sb,"</IMETHODCALL>\n");
- addXmlFooter(sb);
-
- error = con->ft->addPayload(con,sb);
-
- CMSetStatus (&con->mStatus, CMPI_RC_OK );
-
- if (error || (error = con->ft->getEnumResponse(con, cop))) {
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
- free(error);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- if (con->mStatus.rc != CMPI_RC_OK) {
- if (rc)
- *rc=cloneStatus(con->mStatus);
- CMRelease(sb);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- /*
- * allocate an empty enumeration , to be filled in
- * by the scan of the xml data in enumScanThrd .
- */
-
- retEnum = newCMPIEnumeration(NULL , NULL);
-
- /*
- * copy addresses so parsing can find our connection and
- * the enumeration.
- */
-
- retNatEnum = (struct native_enum *) retEnum ;
- retNatEnum->econ = con ;
- retNatEnum->ecop = cop ;
- con->asynRCntl.enmp = (struct native_enum *) retEnum ;
-
- pthrd_error = pthread_create(&enum_scanthrd_id,
- NULL,
- (void*)&enumScanThrd,
- (void*)retNatEnum);
- /*
- * if enumClasses Couldn't run thread pthrd_error , system error
- * otherwise we are OK , set status appropriately
- */
- if(pthrd_error != 0){
- CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
- } else {
- CMSetStatus(rc,CMPI_RC_OK);
- }
-
- CMRelease(sb);
-
- return retEnum;
-
-}
-/* --------------------------------------------------------------------------*/
-/* finished & working */
-static CMPIEnumeration* enumClassNames(
- CMCIClient * mb,
- CMPIObjectPath * cop,
- CMPIFlags flags,
- CMPIStatus * rc)
-{
- ClientEnc *cl=(ClientEnc*)mb;
- CMCIConnection *con=cl->connection;
- UtilStringBuffer *sb=UtilFactory->newStringBuffer(2048);
- char *error;
- CMPIEnumeration *retEnum;
- struct native_enum *retNatEnum;
- pthread_t enum_scanthrd_id = 0 ;
- int pthrd_error = 0 ;
-
- START_TIMING(EnumerateClassNames);
- SET_DEBUG();
-
-
- // con->asynRCntl.enmp = (struct native_enum *)retNatEnum ;
-
- initEscanInfo(con) ;
- if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- con->ft->genEnumRequest(cl, EnumerateClassNames, cop, 0);
-
- /* Construct the CIM-XML request */
- addXmlHeader(sb);
- sb->ft->append3Chars(sb,"<IMETHODCALL NAME=\"", EnumerateClassNames, "\">");
-
- addXmlNamespace(sb, cop);
- emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
- addXmlClassnameParam(sb, cop);
-
- sb->ft->appendChars(sb,"</IMETHODCALL>\n");
- addXmlFooter(sb);
-
- error = con->ft->addPayload(con,sb);
-
- CMSetStatus (&con->mStatus, CMPI_RC_OK );
-
- if (error || (error = con->ft->getEnumResponse(con, cop))) {
- CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
- free(error);
- END_TIMING(_T_FAILED);
- return NULL;
- }
-
- if (con->mStatus.rc != CMPI_RC_OK) {
- if (rc)
- *rc=cloneStatus(con->mStatus);
- CMRelease(sb);
- END_TIMING(_T_FAILED);
- return NULL;
- }
- /*
- * allocate an empty enumeration , to be filled in
- * by the scan of the xml data in enumScanThrd .
- */
-
- retEnum = newCMPIEnumeration(NULL , NULL);
-
- /*
- * copy addresses so parsing can find our connection and
- * the enumeration.
- */
-
- retNatEnum = (struct native_enum *) retEnum ;
- retNatEnum->econ = con ;
- retNatEnum->ecop = cop ;
- con->asynRCntl.enmp = (struct native_enum *) retEnum ;
-
- pthrd_error = pthread_create(&enum_scanthrd_id,
- NULL,
- (void*)&enumScanThrd,
- (void*)retNatEnum);
- /*
- * if enumClassNames Couldn't run thread pthrd_error , system error
- * otherwise we are OK , set status appropriately
- */
- if(pthrd_error != 0){
- CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
- } else {
- CMSetStatus(rc,CMPI_RC_OK);
- }
-
- CMRelease(sb);
-
- return retEnum;
-
-}
-
-/* --------------------------------------------------------------------------*/
-static char* genEnumRequest(ClientEnc *cle, const char *op,
- CMPIObjectPath *cop, int classWithKeys)
-{
- CMCIConnection *con = cle->connection;
- CMCIClientData *cld = &cle->data;
- UtilList *nsc;
- char method[256] = "CIMMethod: ";
- char CimObject[512] = "CIMObject: ";
- char *nsp;
- int isEnumOp = 0 ;
- int chunkedTransfer = 0 ;
-
- if (!con->mHandle) return "Unable to initialize curl interface.";
-
-// if (!supportsSSL() && url.scheme == "https")
-// throw HttpException("this curl library does not support https urls.");
-
- /*
- * check to see if this is an enumeration
- */
- if((strcmp(op , EnumerateInstances )) == 0) {
- chunkedTransfer = 1 ;
- isEnumOp = 1 ;
- con->asynRCntl.eMethodType = ENUMERATEINSTANCES ;
- } else
- if((strcmp(op , EnumerateInstanceNames )) == 0) {
- chunkedTransfer = 1 ;
- isEnumOp = 1 ;
- con->asynRCntl.eMethodType = ENUMERATEINSTANCENAMES ;
- } else
- if((strcmp(op , EnumerateClasses )) == 0) {
- chunkedTransfer = 1 ;
- isEnumOp = 1 ;
- con->asynRCntl.eMethodType = ENUMERATECLASSES ;
- } else
- if((strcmp(op , EnumerateClassNames )) == 0) {
- chunkedTransfer = 1 ;
- isEnumOp = 1 ;
- con->asynRCntl.eMethodType = ENUMERATECLASSNAMES ;
- } else {
- isEnumOp = 0 ; /* some other operation */
- }
-
- con->mResponse->ft->reset(con->mResponse);
-
- con->mUri->ft->reset(con->mUri);
- con->mUri->ft->append6Chars(con->mUri, cld->scheme, "://", cld->hostName,
- ":", cld->port, "/cimom");
-
- /* Initialize curl with the url */
- curl_easy_setopt(con->mHandle, CURLOPT_URL,
- con->mUri->ft->getCharPtr(con->mUri));
-
- /* Enable progress checking */
- curl_easy_setopt(con->mHandle, CURLOPT_NOPROGRESS, 0);
-
- /* Reset timeout control */
- con->mTimeout.mTimestampStart = 0;
- con->mTimeout.mTimestampLast = 0;
- con->mTimeout.mFixups = 0;
-
- /* This will be a HTTP post */
- curl_easy_setopt(con->mHandle, CURLOPT_POST, 1);
-
- /* Disable SSL Host verification */
- curl_easy_setopt(con->mHandle, CURLOPT_SSL_VERIFYHOST, 0);
-
- /* Setup authentication */
- curl_easy_setopt(con->mHandle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
-
- /* Set username and password */
- if (cld->user != NULL) {
- UtilStringBuffer *UserPass = con->mUserPass;
-
- UserPass->ft->reset(UserPass);
- UserPass->ft->appendChars(UserPass, cld->user);
- if (cld->pwd)
- UserPass->ft->append3Chars(UserPass, ":", cld->pwd, NULL);
- /* Setup "<userid>:<password>" */
- curl_easy_setopt(con->mHandle, CURLOPT_USERPWD,
- UserPass->ft->getCharPtr(UserPass));
- }
-
- /* initialize status */
- CMSetStatus(&con->mStatus,CMPI_RC_OK);
-
- /* Setup connect timeouts for cimserver operations */
- curl_easy_setopt(con->mHandle, CURLOPT_NOSIGNAL, 1);
- curl_easy_setopt(con->mHandle, CURLOPT_CONNECTTIMEOUT, CIMSERVER_TIMEOUT);
-
- /* setup callback for client timeout calculations */
- curl_easy_setopt(con->mHandle, CURLOPT_PROGRESSFUNCTION, enumCheckProgress);
- curl_easy_setopt(con->mHandle, CURLOPT_PROGRESSDATA, con);
-
- // Initialize default headers
- con->ft->initializeHeaders(con);
-
- /*
- * check for chunk transfer or no chunk
- */
-
- if(chunkedTransfer == 1){
- /*
- * only use http chunk if these enumeration requests come in
- */
- if(isEnumOp) {
- con->mHeaders = curl_slist_append(con->mHeaders, "TE: trailers ");
- }
- }
-
- // Add CIMMethod header
- strcat(method, op);
- con->mHeaders = curl_slist_append(con->mHeaders, method);
-
- // Add CIMObject header with cop's namespace, class, keys
- if (classWithKeys)
- pathToChars(cop, NULL, &CimObject[11], 1);
- else {
- nsc = getNameSpaceComponents(cop);
- nsp = nsc->ft->getFirst(nsc);
- while (nsp != NULL) {
- strcat(CimObject, nsp);
- free(nsp); /* VM: freeing strdup'ed memory - should be part of release */
- if ((nsp = nsc->ft->getNext(nsc)) != NULL)
- strcat(CimObject, "%2F");
- }
- CMRelease(nsc);
- }
- con->mHeaders = curl_slist_append(con->mHeaders, CimObject);
-
- // Set all of the headers for the request
- curl_easy_setopt(con->mHandle, CURLOPT_HTTPHEADER, con->mHeaders);
-
- // Set up the callbacks to store the response
- if(isEnumOp){
- curl_easy_setopt(con->mHandle, CURLOPT_WRITEFUNCTION, enumWriteCb);
- //Use CURLOPT_FILE instead of CURLOPT_WRITEDATA - more portable
- curl_easy_setopt(con->mHandle, CURLOPT_FILE, con);
- // SAVE ME curl_easy_setopt(con->mHandle, CURLOPT_FILE, con->mResponse);
- // Header processing:
- curl_easy_setopt(con->mHandle, CURLOPT_WRITEHEADER, con);
- curl_easy_setopt(con->mHandle, CURLOPT_HEADERFUNCTION, enumWriteHeaders);
- } else {
- curl_easy_setopt(con->mHandle, CURLOPT_WRITEFUNCTION, writeCb);
-
- // Use CURLOPT_FILE instead of CURLOPT_WRITEDATA - more portable
- curl_easy_setopt(con->mHandle, CURLOPT_FILE, con->mResponse);
-
- // Header processing:
- curl_easy_setopt(con->mHandle, CURLOPT_WRITEHEADER, &con->mStatus);
- curl_easy_setopt(con->mHandle, CURLOPT_HEADERFUNCTION, writeHeaders);
- }
-
- // Fail if we receive an error (HTTP response code >= 300)
- curl_easy_setopt(con->mHandle, CURLOPT_FAILONERROR, 1);
-
- return NULL;
-}
-
-/* --------------------------------------------------------------------------*/
-
-static size_t enumWriteHeaders(void *ptr, size_t size,
- size_t nmemb, void *stream)
-{
- CMCIConnection *con = stream ;
- CMPIStatus *status=(CMPIStatus*)&con->mStatus ;
- char *str=ptr;
- char *colonidx;
- int length = 0 ;
-
- if (str[nmemb-1] != 0) {
- /* make sure the string is zero-terminated */
- str = malloc(nmemb + 1);
- memcpy(str,ptr,nmemb);
- str[nmemb] = 0;
- } else {
- str = strdup(ptr);
- }
- colonidx=strchr(str,':');
-
- if (colonidx) {
- *colonidx=0;
- if (strcasecmp(str,"cimstatuscode") == 0) {
- /* set status code */
- status->rc = atoi(colonidx+1);
- con->asynRCntl.xfer_state = XFER_COMPLETE ;
- }
- else if (strcasecmp(str, "cimstatuscodedescription") == 0) {
- status->msg=newCMPIString(colonidx+1,NULL);
- }
- else if (strcasecmp(str, "content-length") == 0) {
- length = atoi(colonidx+1);
- /*
- * even though we sent for chunk response and expect a trailer
- * we can get all the data back without getting a trailer !
- * keep track of this for checkProgress function.
- * in both cases signal enumResponseThrd.
- */
- con->asynRCntl.xfer_state = XFER_RESP_CL ;
- pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
- pthread_cond_signal( &con->asynRCntl.xfer_cond );
- pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex );
- }
- else if (strncasecmp(str, "Transfer-encoding" , 17) == 0) {
- if (strncasecmp(colonidx+2, "chunked" , 7) == 0){
- con->asynRCntl.xfer_state = XFER_RESP_TEC ;
- pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
- pthread_cond_signal( &con->asynRCntl.xfer_cond );
- pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex );
-
- }
- }
- }
-
- if (strncasecmp(str, "Transfer-encoding" , 17) == 0) {
- // printf(" enumWriteHeaders we see Transfer-encoding: 2nd one \n") ;
- }
-
- free(str);
- return nmemb;
-}
-
-/* --------------------------------------------------------------------------*/
-
-static size_t enumWriteCb(void *ptr, size_t size,
- size_t nmemb, void *stream)
-{
- CMCIConnection *con = stream ;
- int retcode = 0;
-
- UtilStringBuffer *sb=(UtilStringBuffer*)con->mResponse ;
-
- /*
- * lock connection structure here
- */
- if((retcode = pthread_mutex_lock(&(con->asynRCntl.escanlock))) != 0){
- // printf(" enumWriteCb pthread lock return code %d\n",retcode) ;
- }
-
- unsigned int length = size * nmemb;
- sb->ft->appendBlock(sb, ptr, length);
-
- /*
- * maintain escanInfo base pointer and end of data offset
- */
- con->asynRCntl.escanInfo.base = sb->hdl ;
- con->asynRCntl.escanInfo.eodoff = con->asynRCntl.escanInfo.eodoff + length ;
- con->asynRCntl.escanInfo.recdtotl = con->asynRCntl.escanInfo.recdtotl + length ;
-
- /*
- * unlock connection structure here
- */
- if((retcode = pthread_mutex_unlock(&(con->asynRCntl.escanlock))) != 0){
- //printf(" enumWriteCb ptread lock return code %d\n",retcode) ;
- }
-
- if(length > 0)
- con->asynRCntl.xfer_state = XFER_DATA_RECVD ;
-
- return length;
-}
-
-/* --------------------------------------------------------------------------*/
-
-void *enumResponseThrd(CMCIConnection *con)
-{
-CURLcode rv ; /* CURL error code */
-
- if(con->asynRCntl.xfer_state == XFER_NOT_STARTED){
- con->asynRCntl.xfer_state = XFER_GENRQST ;
- } else {
- // printf(" enumResponseThrd xfer_state = %d is out of sequence !!!!!!!!!!! \n",
- // con->asynRCntl.xfer_state) ;
- }
-
- rv = curl_easy_perform(con->mHandle);
-
- /* indicate timeout error for aborted by progess handler */
- if (rv == CURLE_ABORTED_BY_CALLBACK) {
- rv = CURLE_OPERATION_TIMEOUTED;
- }
-
- if (rv) {
- CMSetStatus(&con->mStatus,CMPI_RC_ERROR_SYSTEM);
- }
-
-}
-
-/* --------------------------------------------------------------------------*/
-
-char *getEnumResponse(CMCIConnection *con, CMPIObjectPath *cop)
-{
- CURLcode rv;
- pthread_t enum_rthd_id = 0 ;
- int pthrd_error = 0 ;
- struct timespec tp ;
- int rc = 0 ;
-
-
- pthrd_error = pthread_create(&enum_rthd_id,
- NULL,
- (void*)&enumResponseThrd,
- (void*)con);
- /*
- * if we cannot create the thread return error
- */
- if(pthrd_error != 0){
- // fprintf(stderr, "getEnumResponse Couldn't run enumResponseThrd errno %d\n", pthrd_error);
- return strdup("Error from pthread_create of enumResponseThrd");
- }
-
- pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
- clock_gettime(CLOCK_REALTIME, &tp);
- tp.tv_sec += TIMEDELAY;
- rc = pthread_cond_timedwait(&con->asynRCntl.xfer_cond, &con->asynRCntl.xfer_cond_mutex , &tp);
- pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex);
- /*
- * if we didn't get something back from server in TIMEDELAY seconds
- * we are calling it an error and cancel the thread.
- */
- if(rc != 0) {
- // printf(" - DEBUG getEnumResponse pthread_cond_timedwait - TIMEDOUT !!!! rc = %d!!!\n",rc) ;
- pthread_cancel(enum_rthd_id);
- return strdup("No data received from server");
- }
-
- if(con->mStatus.rc != CMPI_RC_OK)
- {
- pthread_cancel(enum_rthd_id);
- return strdup("failed curl_easy_perform call");
- }
-
- return NULL;
-}
-static int enumCheckProgress(void *data,
- double total,
- double actual,
- double ign1,
- double ign2)
-{
- CMCIConnection *con = (CMCIConnection *) data ;
- struct _TimeoutControl * timeout;
-
- timeout = &con->mTimeout ;
- time_t timestampNow = time(NULL);
-
- if (total > 0 ){
- if (total == actual){
- con->asynRCntl.xfer_state = XFER_COMPLETE ;
- }
- }
- /* we received everything and don't care about timeouts */
- if (total == actual) {
- return 0;
- }
- if (timeout->mFixups > MAX_PROGRESS_FIXUPS) {
- /* to many fixups occured -> fail */
- return 1;
- }
- if (timeout->mTimestampStart == 0 ||
- timeout->mTimestampLast > timestampNow ||
- timestampNow - timeout->mTimestampLast > MAX_PLAUSIBLE_PROGRESS ) {
- /* need to fix up - either first call or system time changed */
- timeout->mFixups += 1;
- timeout->mTimestampStart = timestampNow;
- timeout->mTimestampLast = timestampNow;
- return 0;
- }
- if (timestampNow - timeout->mTimestampStart < CIMSERVER_TIMEOUT) {
- timeout->mTimestampLast = timestampNow;
- return 0;
- } else {
- return 1;
- }
-}
-
-/* --------------------------------------------------------------------------*/
-void initEscanInfo(CMCIConnection * con) {
- con->asynRCntl.escanInfo.base = 0;
- con->asynRCntl.escanInfo.eodoff = 1;
- con->asynRCntl.escanInfo.ssecoff = 0;
- con->asynRCntl.escanInfo.curoff = 0;
- con->asynRCntl.escanInfo.section = 0;
- con->asynRCntl.escanInfo.sectlen = 0;
- con->asynRCntl.escanInfo.prevtotl= 0;
- con->asynRCntl.escanInfo.recdtotl= 0;
- con->asynRCntl.escanInfo.getnew = 1; /* set so we getnext section right away */
- con->asynRCntl.escanInfo.parsestate = PARSTATE_INIT;
- con->asynRCntl.escanlock = init_mutex;
- con->asynRCntl.xfer_cond_mutex = init_mutex;
- con->asynRCntl.xfer_cond = init_cond;
-}
-/* --------------------------------------------------------------------------*/
-
-#endif
diff --git a/backend/cimxml/enumeration.c b/backend/cimxml/enumeration.c
index f6da0dc..1fa1103 100644
--- a/backend/cimxml/enumeration.c
+++ b/backend/cimxml/enumeration.c
@@ -32,25 +32,11 @@
#include "cimXmlParser.h" // new
#include "utilStringBuffer.h" // new
-#ifndef LARGE_VOL_SUPPORT
-
#include "native.h"
#include <time.h> // new
#include <sys/time.h> // new
#include "conn.h" // new
-#else
-
-
-
-#include "native.h"
-#include <time.h> // new
-#include <sys/time.h> // new
-#include "esinfo.h" // new
-#include "conn.h" // new
-
-#endif
-
static CMPIStatus __eft_release ( CMPIEnumeration * );
static CMPIEnumeration * __eft_clone ( CMPIEnumeration * , CMPIStatus *);
static CMPIData __eft_getNext ( CMPIEnumeration * ,CMPIStatus * );
@@ -103,8 +89,6 @@
return CMGetArrayElementAt ( e->data, e->current++, rc );
}
-#ifndef LARGE_VOL_SUPPORT
-
static CMPIBoolean __eft_hasNext ( CMPIEnumeration * enumeration,
CMPIStatus * rc )
{
@@ -112,8 +96,6 @@
return ( e->current < CMGetArrayCount ( e->data, rc ) );
}
-#endif
-
static CMPIArray * __eft_toArray ( CMPIEnumeration * enumeration,
CMPIStatus * rc )
{
@@ -144,12 +126,8 @@
enumeration->enumeration = e;
enumeration->data = array; /* CMClone ( array, rc ) ? */
-#ifdef LARGE_VOL_SUPPORT
- enumeration->econ = NULL ;
- enumeration->ecop = NULL ;
-#endif
- CMSetStatus ( rc, CMPI_RC_OK );
- return enumeration;
+ CMSetStatus ( rc, CMPI_RC_OK );
+ return enumeration;
}
@@ -160,71 +138,6 @@
}
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
-/****************************************************************************/
-
-#ifdef LARGE_VOL_SUPPORT
-#define TIMEOUTVALUE 2000
-static CMPIBoolean __eft_hasNext ( CMPIEnumeration * enumeration,
- CMPIStatus * rc )
-{
- int hasNextTO = 0 ; /* timeout */
- struct native_enum * e = (struct native_enum *) enumeration;
-
- if(e->econ){
- CMCIConnection *con = e->econ ;
-
- /*
- * need to be cautious here because the array might not be
- * allocated yet , so we pause till we are past PARSTATE_INIT.
- * cycle "roughly" 20 seconds ?? if we didn't get past
- * PARSTATE_INIT , something is wrong.
- */
-
- while(con->asynRCntl.escanInfo.parsestate == PARSTATE_INIT){
- usleep(10000) ;
- hasNextTO++ ;
- if(hasNextTO > TIMEOUTVALUE){
- CMSetStatus(rc,CMPI_RC_ERROR);
- return(0);
- }
- }
-
- /*
- * if we caught up with the parsing (current > or = ArrayCount)
- * then we delay a bit if we haven't reached PARSTATE_COMPLETE.
- * if parsing sees the server timeout , also exit so we don't hang here
- * forever.
- *
- */
- hasNextTO = 0 ;
- if(hasNextTO < TIMEOUTVALUE){
- if(((CMGetArrayCount ( e->data, rc )) <= (e->current)) &&
- con->asynRCntl.escanInfo.parsestate != PARSTATE_COMPLETE) {
- while((CMGetArrayCount ( e->data, rc )) <= (e->current)){
- usleep(10000) ;
- hasNextTO++ ;
- if(hasNextTO > TIMEOUTVALUE){
- CMSetStatus(rc,CMPI_RC_ERROR);
- return(0);
- }
- if((con->asynRCntl.escanInfo.parsestate == PARSTATE_COMPLETE)||
- (con->asynRCntl.escanInfo.parsestate == PARSTATE_SERVER_TIMEOUT)){
- CMSetStatus(rc,CMPI_RC_ERROR);
- return(0) ;
- }
- }
- }
- }
- }
-
- return ( e->current < CMGetArrayCount ( e->data, rc ) );
-
-}
-
-#endif
/*** Local Variables: ***/
/*** mode: C ***/
/*** c-basic-offset: 8 ***/
diff --git a/configure.ac b/configure.ac
index 484dfb4..0d5053d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,13 +15,6 @@
[enable_http_chunking="yes"]
)
-AC_ARG_ENABLE(large_volume_support,
- [AC_HELP_STRING([--enable-large_volume_support],
- [large_volume_support uses http chunk for enumclasses,enumclassnames,enuminstances,enuminstancenames.])],
- [large_volume_support=$enableval],
- [large_volume_support="no"]
- )
-
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
@@ -29,13 +22,6 @@
# Checks for libraries.
-#
-if test "$large_volume_support" == "yes" ; then
- echo "enabled to compile for large volume support"
- CPPFLAGS="-DLARGE_VOL_SUPPORT $CPPFLAGS"
- LIBS="$LIBS -lrt"
-fi
-
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stddef.h stdlib.h string.h sys/time.h])
diff --git a/frontend/sfcc/conn.h b/frontend/sfcc/conn.h
index bc303f6..9042564 100644
--- a/frontend/sfcc/conn.h
+++ b/frontend/sfcc/conn.h
@@ -10,7 +10,6 @@
time_t mTimestampLast;
unsigned mFixups;
};
-#ifndef LARGE_VOL_SUPPORT
struct _CMCIConnection {
CMCIConnectionFT *ft;
CURL *mHandle; // The handle to the curl object
@@ -22,21 +21,6 @@
CMPIStatus mStatus; // returned request status (via HTTP trailers)
struct _TimeoutControl mTimeout; /* Used for timeout control */
};
-#else
-struct _CMCIConnection {
- CMCIConnectionFT *ft;
- CURL *mHandle; // The handle to the curl object
- struct curl_slist *mHeaders; // The list of headers sent with each request
- UtilStringBuffer *mBody; // The body of the request
- UtilStringBuffer *mUri; // The uri of the request
- UtilStringBuffer *mUserPass; // The username/password used in authentication
- UtilStringBuffer *mResponse; // Used to store the HTTP response
- CMPIStatus mStatus; // returned request status (via HTTP trailers)
- struct _TimeoutControl mTimeout; /* Used for timeout control */
- struct asyncrespcntl asynRCntl ;/* sync response */
-};
-
-#endif /* endif LARGE_VOL_SUPPORT */
#ifdef __cplusplus
}
diff --git a/frontend/sfcc/esinfo.h b/frontend/sfcc/esinfo.h
deleted file mode 100644
index 246c4d1..0000000
--- a/frontend/sfcc/esinfo.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef _ES_INFO_H
-#define _ES_INFO_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef LARGE_VOL_SUPPORT
-/* ************************************************** */
-/* */
-/* keep track of where we have scanned so far for the */
-/* synchronous data we received */
-/* */
-/* ************************************************** */
-
-typedef struct enumScanInfo {
- char *base; /* base pointer to response data */
- int eodoff; /* end of the response data so far */
- int ssecoff; /* start of section offset */
- int curoff; /* current offset */
- char *section; /* buffer pointer */
- int sectlen; /* buffer length */
- int prevtotl; /* previous total received bytes */
- int recdtotl; /* total received bytes enumwriteCB*/
- int getnew;
- int parsestate;
-} enumScanInfo ;
-/*
- * parsing state definitions
- *
- */
-#define PARSTATE_INIT 00 /* parsing hasnot started yet */
-#define PARSTATE_STARTED 05 /* at least some data has been parsed */
-#define PARSTATE_COMPLETE 10 /* parseing is complete */
-#define PARSTATE_SERVER_TIMEOUT 20 /* timeout from getting data */
-
-
-struct asyncrespcntl{
- int xfer_state ; /* The state of the transfer */
- int eMethodType; /* type of enumeration in progress */
-struct native_enum *enmp ; /* enumeration pointer */
-pthread_mutex_t escanlock ; /* mutex lock */
-pthread_mutex_t xfer_cond_mutex ;
-pthread_cond_t xfer_cond ;
-struct enumScanInfo escanInfo; /* response control */
-} asyncrespcntl ;
-/*
- * asyncrespcntl info
- *
- * escanlock - lock the use of escanInfo
- *
- * xfer_cond -pthread condition variable which holds us from
- * continuing until we have received something
- * from the server .
- * wait in getEnumResonse
- * set in enumWriteHeaders
- *
- */
-
-
-/*
- * xfer_states
- */
-#define XFER_NOT_STARTED 0 /* no valid data yet */
-#define XFER_GENRQST 5 /* we have gotten the request built */
- /* and will be sending it next. */
-#define XFER_RESP_TEC 10 /* we received a response header */
- /* with Transfer Encoding: chunked */
-#define XFER_RESP_CL 15 /* we received a response header */
- /* with content-length */
-#define XFER_DATA_RECVD 20 /* we have recieved some data */
-#define XFER_COMPLETE 25 /* xfer is complete */
-#define XFER_ERROR 30 /* we had an error */
-/*
- * Enumeration request types
- */
-#define ENUMERATEINSTANCES 1
-#define ENUMERATEINSTANCENAMES 2
-#define ENUMERATECLASSES 3
-#define ENUMERATECLASSNAMES 4
-
-/*
- * macros and prototypes
- */
-#define B(x) (x->base)
-#define O(x) (x->curoff)
-
-inline char * CURPTR (enumScanInfo * );
-inline char * SSECPTR (enumScanInfo * );
-inline char * LASTPTR (enumScanInfo * );
-inline void INCOFF (enumScanInfo * );
-
-#endif /* ifdef LARGE_VOL_SUPPORT */
-
-#ifdef __cplusplus
- }
-
-#endif
-
-#endif
diff --git a/frontend/sfcc/native.h b/frontend/sfcc/native.h
index 354bbd1..aa1e4ff 100644
--- a/frontend/sfcc/native.h
+++ b/frontend/sfcc/native.h
@@ -41,23 +41,12 @@
/* */
/* ************************************************** */
-#ifndef LARGE_VOL_SUPPORT
struct native_enum {
CMPIEnumeration enumeration;
CMPICount current;
CMPIArray * data;
};
-#else
-struct native_enum {
- CMPIEnumeration enumeration;
-
- CMPICount current;
- CMPIArray * data;
- CMCIConnection * econ;
- CMPIObjectPath * ecop;
-};
-#endif
//! Forward declaration for anonymous struct.
struct native_property;