From: Michael Chase-S. <mc...@us...> - 2013-03-09 01:06:35
|
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 1a609f114e3569e7f5e28dce16d664400124524f (commit) from 3884f36555f8f67c46ae81162e14daadef3b15bd (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 1a609f114e3569e7f5e28dce16d664400124524f Author: Michael Chase-Salerno <br...@li...> Date: Fri Mar 8 20:04:55 2013 -0500 [sfcb-tix#13] Optimize Handler Sequence numbers ----------------------------------------------------------------------- Summary of changes: indCIMXMLHandler.c | 19 ++++++++++++++++--- interopProvider.c | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c index cfda7d3..54d085c 100644 --- a/indCIMXMLHandler.c +++ b/indCIMXMLHandler.c @@ -880,7 +880,6 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerInvokeMethod"); CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIStatus circ = { CMPI_RC_OK, NULL }; int drc = 0; struct timeval tv; struct timezone tz; @@ -922,7 +921,15 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, sub=CMGetArg(in,"subscription",NULL).value.inst; CMPIData handler=CMGetProperty(sub, "Handler", &st); CMPIObjectPath *hop=handler.value.ref; - CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st); + // Get the handler instance from the hashtable via a + // methodcall to interopProvider + in=CMNewArgs(_broker,NULL); + CMAddArg(in,"handler",&hop,CMPI_ref); + out=CMNewArgs(_broker,NULL); + CMPIObjectPath* sop=CMNewObjectPath(_broker,"root/interop","cim_indicationsubscription",&st); + CBInvokeMethod(_broker,ctx,sop,"_getHandler",in,out,&st); + CMPIInstance *hdlr=CMGetArg(out,"hin",NULL).value.inst; + if (hdlr == NULL) { mlogf(M_ERROR,M_SHOW,"Deliver indication failed, hdlr is null. rc:%d\n",st.rc); _SFCB_RETURN(st); @@ -947,7 +954,13 @@ IndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, if (lastseq.sint64 < 0) lastseq.sint64=0; // Update the last used number in the handler CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64); - CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL); + in=CMNewArgs(_broker,NULL); + CMAddArg(in,"handler",&hdlr,CMPI_instance); + CMAddArg(in,"key",&hop,CMPI_ref); + CBInvokeMethod(_broker,ctx,sop,"_updateHandler",in,NULL,&st); + if (st.rc != CMPI_RC_OK) { + mlogf(M_ERROR,M_SHOW,"Failed to update LastSequenceNumber. rc:%d\n",st.rc); + } // And the indication CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64); } diff --git a/interopProvider.c b/interopProvider.c index ef8744e..aba28df 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -1679,6 +1679,21 @@ InteropProviderInvokeMethod(CMPIMethodMI * mi, _SFCB_TRACE(1,("--- _updateHandler %s %s",(char*)ns->hdl,(char*)str->hdl)); updateHandler(ci,op); } + else if (strcasecmp(methodName, "_getHandler") == 0) { + // Return a handler instance from the hashtable + CMPIObjectPath *op = CMGetArg(in, "handler", &st).value.ref; + CMPIString *ops=op->ft->toString(op,NULL); + char *key = normalizeObjectPathCharsDup(op); + Handler *ha = getHandler(key); + + if (ha) { + CMAddArg(out, "hin", &ha->hci, CMPI_instance); + } else { + setStatus(&st, CMPI_RC_ERR_NOT_FOUND, "Handler object not found"); + } + if (key) + free(key); + } else if (strcasecmp(methodName, "_startup") == 0) { initInterOp(_broker, ctx); hooks/post-receive -- sfcb - Small Footprint CIM Broker |