From: Chris B. <buc...@us...> - 2013-10-18 21:47:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcb - Small Footprint CIM Broker". The branch, master_1.3 has been updated via b19b5389585c7e53fce17831586c0bf7729b50e5 (commit) via 23865303aad409af621489fda3994b0e6f570068 (commit) via 1b12a64d833c2fa34bc2fa72f2466f003010cf9a (commit) via fbcf1c2defe64c31dfc8ca3a404b76a69679fcf6 (commit) from 45a53e6e01366a1ce884b418f5c9b807bfcac8b6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b19b5389585c7e53fce17831586c0bf7729b50e5 Author: buccella <buc...@li...> Date: Fri Oct 18 17:46:48 2013 -0400 [sfcb-tix:#84 Upcall mutex not freed on shutdown commit 23865303aad409af621489fda3994b0e6f570068 Author: buccella <buc...@li...> Date: Fri Oct 18 17:46:03 2013 -0400 [sfcb-tix:#85 SFCB: SfcbLocal interface should expose markHeap() and releaseHeap() commit 1b12a64d833c2fa34bc2fa72f2466f003010cf9a Author: buccella <buc...@li...> Date: Fri Oct 18 17:40:29 2013 -0400 [sfcb-tix:#82] ClientEnvFT for SfcbLocal doesn't match SFCC commit fbcf1c2defe64c31dfc8ca3a404b76a69679fcf6 Author: buccella <buc...@li...> Date: Fri Oct 18 17:23:51 2013 -0400 [sfcb-tix:#83] Add Alternate getObjectPath() for SfcbLocal Connections ----------------------------------------------------------------------- Summary of changes: brokerUpc.c | 10 ++++++- cimcClientSfcbLocal.c | 19 ++++++++++++ cimcClientSfcbLocal.h | 3 ++ instance.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 105 insertions(+), 2 deletions(-) diff --git a/brokerUpc.c b/brokerUpc.c index 1d9f695..96d4287 100644 --- a/brokerUpc.c +++ b/brokerUpc.c @@ -71,9 +71,17 @@ void closeProviderContext(BinRequestContext * ctx); static CMPI_MUTEX_TYPE mtx=NULL; +void freeUpCallMtx() +{ + free(mtx); +} + void lockUpCall(const CMPIBroker* mb) { - if (mtx==NULL) mtx=mb->xft->newMutex(0); + if (mtx==NULL) { + mtx=mb->xft->newMutex(0); + atexit(freeUpCallMtx); + } mb->xft->lockMutex(mtx); } diff --git a/cimcClientSfcbLocal.c b/cimcClientSfcbLocal.c index 38a79d1..3c1545e 100644 --- a/cimcClientSfcbLocal.c +++ b/cimcClientSfcbLocal.c @@ -2029,6 +2029,22 @@ void _Cleanup_SfcbLocal_Env(void) _SFCB_TRACE_STOP(); } +void * newIndicationListener(ClientEnv *ce, int sslMode, int *portNumber, char **socketName, + void (*fp) (CMPIInstance *indInstance), CMPIStatus* rc) +{ + fprintf(stderr, "*** newIndicationListener not supported for SfcbLocal\n"); + return NULL; +} + +void * _markHeap() { + return markHeap(); +} + +void _releaseHeap(void* heap) { + releaseHeap(heap); + return; +} + ClientEnv* _Create_SfcbLocal_Env(char *id, unsigned int options, int *rc, char **msg) { @@ -2045,6 +2061,9 @@ ClientEnv* _Create_SfcbLocal_Env(char *id, unsigned int options, int *rc, char * newDateTime, newDateTimeFromBinary, newDateTimeFromChars, + newIndicationListener, + _markHeap, + _releaseHeap, }; // localClientMode=1; diff --git a/cimcClientSfcbLocal.h b/cimcClientSfcbLocal.h index 752fe8f..f0eeb5a 100644 --- a/cimcClientSfcbLocal.h +++ b/cimcClientSfcbLocal.h @@ -175,6 +175,9 @@ typedef struct _ClientEnvFT { (ClientEnv *ce, CMPIUint64 binTime, CMPIBoolean interval, CMPIStatus* rc); CMPIDateTime* (*newDateTimeFromChars) (ClientEnv *ce, const char *utcTime, CMPIStatus* rc); + void* (*newIndicationListener) + (ClientEnv *ce, int sslMode, int *portNumber, char **socketName, + void (*fp) (CMPIInstance *indInstance), CMPIStatus* rc); } ClientEnvFT; struct _ClientEnv { diff --git a/instance.c b/instance.c index 12af95f..5727d72 100644 --- a/instance.c +++ b/instance.c @@ -513,6 +513,79 @@ static CMPIObjectPath *__ift_getObjectPath(const CMPIInstance * instance, return cop; } +/* same as ift_gOP(), but used for SfcbLocal clients + eliminated klt hashtable, call mm to release tracked + CMPI objects before exiting */ +static CMPIObjectPath * +__iftLocal_getObjectPath(const CMPIInstance *instance, CMPIStatus *rc) +{ + int j, + f = 0; + CMPIStatus tmp; + const char *cn; + const char *ns; + void* hc; + + if (!instance->hdl) { + if (rc) + CMSetStatus(rc, CMPI_RC_ERR_INVALID_HANDLE); + return NULL; + } + + cn = ClInstanceGetClassName((ClInstance *) instance->hdl); + ns = ClInstanceGetNameSpace((ClInstance *) instance->hdl); + + CMPIObjectPath *cop = TrackedCMPIObjectPath(ns, cn, rc); + + if (rc && rc->rc != CMPI_RC_OK) + return NULL; + + j = __ift_getPropertyCount(instance, NULL); + + hc = markHeap(); + while (j--) { + char *keyName; + CMPIData d = + __ift_internal_getPropertyAt(instance, j, &keyName, &tmp, 1); + if (d.state & CMPI_keyValue) { + CMAddKey(cop, keyName, &d.value, d.type); + f++; + } + if (d.type & CMPI_ARRAY && (d.state & CMPI_nullValue) == 0) { + d.value.array->ft->release(d.value.array); + } + } + + if (f == 0) { + CMPIArray *kl; + CMPIData d; + unsigned int e, + m; + + CMPIConstClass *cc = getConstClass(ns, cn); + if (cc) { + kl = cc->ft->getKeyList(cc); + } else { + if (rc) { + CMSetStatus(rc, CMPI_RC_ERR_INVALID_CLASS); + } + releaseHeap(hc); + return NULL; + } + m = kl->ft->getSize(kl, NULL); + + for (e = 0; e < m; e++) { + CMPIString *n = kl->ft->getElementAt(kl, e, NULL).value.string; + d = __ift_getProperty(instance, CMGetCharPtr(n), &tmp); + if (tmp.rc == CMPI_RC_OK) { + CMAddKey(cop, CMGetCharPtr(n), &d.value, d.type); + } + } + CMRelease(kl); + } + releaseHeap(hc); + return cop; +} static CMPIStatus __ift_internal_setPropertyFilter(CMPIInstance * instance, const char **propertyList, @@ -768,7 +841,7 @@ static struct { __ift_getPropertyAt, __ift_getPropertyCount, __ift_setProperty, - __ift_getObjectPath, + __iftLocal_getObjectPath, __ift_setPropertyFilter, __ift_getQualifier, __ift_getQualifierAt, hooks/post-receive -- sfcb - Small Footprint CIM Broker |