From: Dave H. <hel...@us...> - 2013-04-08 20:34:12
|
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 has been updated via 24f0cd959bf6d1cc8227de1f5a613fd157eb5183 (commit) from 212ac056f8eaba07485f21ad3e1b2f6bf6470844 (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 24f0cd959bf6d1cc8227de1f5a613fd157eb5183 Author: Dave Heller <hel...@us...> Date: Mon Apr 8 16:33:01 2013 -0400 [sfcb-tix:#32] Provider Mgr trace should id the provider being called ----------------------------------------------------------------------- Summary of changes: providerMgr.c | 6 ++++-- providerRegister.c | 33 ++++++++++++++++++++++++++++++--- providerRegister.h | 2 ++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/providerMgr.c b/providerMgr.c index 890de33..d834dc1 100644 --- a/providerMgr.c +++ b/providerMgr.c @@ -1494,10 +1494,12 @@ invokeProviders(BinRequestContext * binCtx, int *err, int *count) _SFCB_TRACE(1, ("--- %d providers", binCtx->pCount)); for (i = 0; i < binCtx->pCount; i++, binCtx->pDone++) { - _SFCB_TRACE(1, ("--- Calling provider ...")); binCtx->provA = binCtx->pAs[i]; + _SFCB_TRACE_VAR(ProviderInfo *info = pReg->ft->getProviderById(pReg, binCtx->provA.ids.provId)); + _SFCB_TRACE(1, ("--- Calling provider id: %d type=%lu %s (%s)", + info->id, info->type, info->providerName, info->className)); resp[i] = intInvokeProvider(binCtx, sockets); - _SFCB_TRACE(1, ("--- back from calling provider")); + _SFCB_TRACE(1, ("--- back from calling provider id: %d", info->id)); *count += resp[i]->count; resp[i]->rc--; if (*err == 0 && resp[i]->rc != 0) diff --git a/providerRegister.c b/providerRegister.c index 1d3c775..a3e2172 100644 --- a/providerRegister.c +++ b/providerRegister.c @@ -90,6 +90,9 @@ pRelease(ProviderRegister * br) static int addProviderToHT(ProviderInfo * info, UtilHashTable * ht) { + _SFCB_ENTER(TRACE_PROVIDERMGR, "addProviderToHT"); + _SFCB_TRACE(1, ("--- Add pReg entry id: %d type=%lu %s (%s)", + info->id, info->type, info->providerName, info->className)); ProviderInfo *checkDummy; /* * first we add the provider to the providerRegister with the classname @@ -106,7 +109,7 @@ addProviderToHT(ProviderInfo * info, UtilHashTable * ht) if (strcmp(checkDummy->providerName, info->providerName) == 0) { if (checkDummy->type != info->type) { mlogf(M_ERROR,M_SHOW,"--- Conflicting registration types for class %s, provider %s\n", info->className, info->providerName); - return 1; + _SFCB_RETURN(1); } /* FIXME: check location, user, group, parms, unload */ /* classname and provider name match, now check for namespace */ @@ -115,7 +118,7 @@ addProviderToHT(ProviderInfo * info, UtilHashTable * ht) if (strcmp(checkDummy->ns[idx], info->ns[0]) == 0) { /* double registration - discard */ freeInfoPtr(info); - return 0; + _SFCB_RETURN(0); } ++idx; } @@ -133,7 +136,7 @@ addProviderToHT(ProviderInfo * info, UtilHashTable * ht) } else { ht->ft->put(ht, info->className, info); } - return 0; + _SFCB_RETURN(0); } ProviderRegister * @@ -405,6 +408,29 @@ getProvider(ProviderRegister * br, const char *clsName, unsigned long type) } static ProviderInfo * +getProviderById(ProviderRegister * br, int id) +{ + ProviderBase *bb = (ProviderBase *) br->hdl; + HashTableIterator *it; + char *key = NULL; + ProviderInfo *info = NULL; + + for (it = bb->ht->ft->getFirst(bb->ht, (void **) &key, (void **) &info); + key && it && info; + it = + bb->ht->ft->getNext(bb->ht, it, (void **) &key, (void **) &info)) { + + while (info) { + if (info->id == id) { + return info; + } + info = info->nextInRegister; + } + } + return NULL; +} + +static ProviderInfo * locateProvider(ProviderRegister * br, const char *provName) { ProviderBase *bb = (ProviderBase *) br->hdl; @@ -459,6 +485,7 @@ static Provider_Register_FT ift = { 1, pRelease, getProvider, + getProviderById, putProvider, removeProvider, locateProvider, diff --git a/providerRegister.h b/providerRegister.h index 8a3837a..a4a06cc 100644 --- a/providerRegister.h +++ b/providerRegister.h @@ -128,6 +128,8 @@ extern "C" { ProviderInfo *(*getProvider) (ProviderRegister * br, const char *clsName, unsigned long type); + ProviderInfo *(*getProviderById) (ProviderRegister * br, + int id); int (*putProvider) (ProviderRegister * br, const char *clsName, ProviderInfo * info); hooks/post-receive -- sfcb - Small Footprint CIM Broker |