osaf/libs/agents/saf/imma/imma_cb.h     |   1 +
 osaf/libs/agents/saf/imma/imma_oi_api.c |  22 +++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)


IMMA uses IMMA_OI_CALLBACK_TIMEOUT for sending OI timeout to IMM service using 
implementer set operations.

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -71,6 +71,7 @@ typedef struct imma_client_node {
      * enviroment variable IMMA_MAX_OPEN_SEARCHES_PER_HANDLE */
     uint32_t maxSearchHandles;
        uint32_t searchHandleSize;      /* Number of open search handles */
+       uint32_t oiTimeout;     /* Timeout for OI callback. If the value is 0, 
the default timeout (6s) will be used */
 } IMMA_CLIENT_NODE;
 
 /* Node to store adminOwner info */
diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -139,6 +139,20 @@ SaAisErrorT saImmOiInitialize_2(SaImmOiH
                cl_node->syncr_timeout = IMMSV_WAIT_TIME; /* Default */
        }
 
+       if(cl_node->isImmA2e && (timeout_env_value = 
getenv("IMMA_OI_CALLBACK_TIMEOUT"))!=NULL) {
+               char *endp = NULL;
+               cl_node->oiTimeout = strtol(timeout_env_value, &endp, 10);
+               if(!endp || *endp) {
+                       TRACE_2("Failed to parse IMMA_OI_CALLBACK_TIMEOUT. "
+                                       "OI timeout will be set to the default 
value");
+                       cl_node->oiTimeout = 0;
+               } else {
+                       TRACE_2("IMMA library OI timeout set to:%u", 
cl_node->oiTimeout);
+               }
+       } else {
+               cl_node->oiTimeout = 0;
+       }
+
        /* Take the CB Lock */
        if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) {
                TRACE_4("ERR_LIBRARY: LOCK failed");
@@ -1270,11 +1284,17 @@ SaAisErrorT saImmOiImplementerSet(SaImmO
        /* Populate & Send the Open Event to IMMND */
        memset(&evt, 0, sizeof(IMMSV_EVT));
        evt.type = IMMSV_EVT_TYPE_IMMND;
-       evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET;
        evt.info.immnd.info.implSet.client_hdl = immOiHandle;
        evt.info.immnd.info.implSet.impl_name.size = nameLen;
        evt.info.immnd.info.implSet.impl_name.buf = implementerName;
 
+       if(cl_node->isImmA2e && cl_node->oiTimeout) {
+               evt.info.immnd.info.implSet.oi_timeout = cl_node->oiTimeout;
+               evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET_2;
+       } else {
+               evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET;
+       }
+
        /* Unlock before MDS Send */
        m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
        locked = false;

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to