(file) Return to CIMServer.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Server

Diff for /pegasus/src/Pegasus/Server/CIMServer.cpp between version 1.190.2.5 and 1.190.2.6

version 1.190.2.5, 2006/10/10 16:46:13 version 1.190.2.6, 2006/10/23 09:24:58
Line 105 
Line 105 
 // l10n // l10n
 #include <Pegasus/Common/MessageLoader.h> #include <Pegasus/Common/MessageLoader.h>
  
 #include <Pegasus/Common/Threads.h>  
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 #ifdef PEGASUS_SLP_REG_TIMEOUT #ifdef PEGASUS_SLP_REG_TIMEOUT
 ThreadReturnType PEGASUS_THREAD_CDECL _advertisePegasus(void *parm); ThreadReturnType PEGASUS_THREAD_CDECL _advertisePegasus(void *parm);
 # define MAX_LIFE 0x0fff  //Definig maximum life of registration as the reregistration interval
   # define MAX_LIFE PEGASUS_SLP_REG_TIMEOUT
 # define SLP_PORT 427 # define SLP_PORT 427
 # define LOCALHOST_IP "127.0.0.1" # define LOCALHOST_IP "127.0.0.1"
 #endif #endif
Line 619 
Line 618 
     Time::gettimeofday(&now);     Time::gettimeofday(&now);
  
 #ifdef PEGASUS_SLP_REG_TIMEOUT #ifdef PEGASUS_SLP_REG_TIMEOUT
     static struct timeval lastReregistrationTime = {0, 0};      static struct timeval lastReregistrationTime = now;
       // units of PEGASUS_SLP_REG_TIMEOUT is minutes. Multiplying PEGASUS_SLP_REG_TIMEOUT
       // to convert in to seconds.
     if (now.tv_sec - lastReregistrationTime.tv_sec > (PEGASUS_SLP_REG_TIMEOUT * 60))     if (now.tv_sec - lastReregistrationTime.tv_sec > (PEGASUS_SLP_REG_TIMEOUT * 60))
     {     {
        lastReregistrationTime.tv_sec = now.tv_sec;        lastReregistrationTime.tv_sec = now.tv_sec;
        _runSLP = true;    // To allow the Reregistration _runSLP is made true.         // To allow the Reregistration _runSLP is made true. This flag is checked
          // in startSLPProvider()
          _runSLP = true;
        startSLPProvider();        startSLPProvider();
          //To disallow the registration call being made from the start of this routine.
          _runSLP = false;
     }     }
 #endif #endif
  
     if (now.tv_sec - lastIdleCleanupTime.tv_sec >= 100)      if (now.tv_sec - lastIdleCleanupTime.tv_sec >= 300)
     {     {
       lastIdleCleanupTime.tv_sec = now.tv_sec;       lastIdleCleanupTime.tv_sec = now.tv_sec;
       try       try
Line 995 
Line 1000 
 { {
  
    PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CIMServer::startSLPProvider");    PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CIMServer::startSLPProvider");
   
     // onetime check is not needed for re-registration.     // onetime check is not needed for re-registration.
     // This is a onetime function.  If already issued, or config is not to use simply     // This is a onetime function.  If already issued, or config is not to use simply
     // return  
     if (!_runSLP)     if (!_runSLP)
     {     {
        return;        return;
Line 1018 
Line 1021 
     // function does not get called a second time.     // function does not get called a second time.
     _runSLP = false;     _runSLP = false;
  
     // Start SLPProvider for Built-in SA and Open SLP SA. if the PEGASUS_SLP_REG_TIMEOUT is defined      // Start SLPProvider for Built-in SA and Open SLP SA. If the
     // start a thread which advertises CIMOM with a external SLP SA.      // PEGASUS_SLP_REG_TIMEOUT is defined and if Open SLP is not used, start a
 #ifdef PEGASUS_SLP_REG_TIMEOUT      // thread which advertises CIMOM with a external SLP SA( i.e . IBM SA).
   #if defined( PEGASUS_SLP_REG_TIMEOUT ) && !defined( PEGASUS_USE_OPENSLP )
     _startAdvThread = true;     _startAdvThread = true;
     Thread SLPThread(_advertisePegasus,0,true);     Thread SLPThread(_advertisePegasus,0,true);
     SLPThread.run();     SLPThread.run();
Line 1035 
Line 1039 
 } }
  
  
   
 // startSLPProvider is a function to get the slp provider kicked off // startSLPProvider is a function to get the slp provider kicked off
 // during startup.  It is placed in the provider manager simply because // during startup.  It is placed in the provider manager simply because
 // the provider manager is the only component of the system is // the provider manager is the only component of the system is
Line 1055 
Line 1060 
     // open connection to CIMOM     // open connection to CIMOM
     //     //
     String hostStr = System::getHostName();     String hostStr = System::getHostName();
   
     try     try
     {     {
         //         //
Line 1118 
Line 1122 
 { {
  
     PEG_METHOD_ENTER(TRC_SERVER, "CIMServer::_advertisePegasus()");     PEG_METHOD_ENTER(TRC_SERVER, "CIMServer::_advertisePegasus()");
       SLPAttrib SLPHttpAttribObj;
     static SLPAttrib SLPHttpAttribObj;      SLPAttrib SLPHttpsAttribObj;
     static SLPAttrib SLPHttpsAttribObj;  
     struct slp_client *client;     struct slp_client *client;
     time_t now,last;     time_t now,last;
     lslpMsg msg_list;     lslpMsg msg_list;
Line 1146 
Line 1149 
  
     scopes = strdup("DEFAULT");     scopes = strdup("DEFAULT");
  
       //Populate datastructures required for registering  a service with External SLP SA (i.e IBM SLP SA)
     type = strdup(SLPHttpAttribObj.getServiceType().getCString());     type = strdup(SLPHttpAttribObj.getServiceType().getCString());
     httpUrl = strdup(SLPHttpAttribObj.getServiceUrl().getCString());     httpUrl = strdup(SLPHttpAttribObj.getServiceUrl().getCString());
     httpsUrl = strdup(SLPHttpsAttribObj.getServiceUrl().getCString());     httpsUrl = strdup(SLPHttpsAttribObj.getServiceUrl().getCString());
Line 1161 
Line 1165 
     {     {
        if (!handleCloseSLPThread)        if (!handleCloseSLPThread)
        {        {
           client->srv_reg_local(client, httpUrl, httpAttrs, type, scopes, life);            int rc_http = client->srv_reg_local(client, httpUrl, httpAttrs, type, scopes, life);
           client->srv_reg_local(client, httpsUrl, httpsAttrs, type, scopes, life);            int rc_https = client->srv_reg_local(client, httpsUrl, httpsAttrs, type, scopes, life);
             if (!rc_http)
             {
                PEGASUS_STD(cerr) << "CIMServer http registration is FAILED with External SLP" << PEGASUS_STD(endl);
             }
             if (!rc_https)
             {
                PEGASUS_STD(cerr) << "CIMServer https registration is FAILED with External SLP" << PEGASUS_STD(endl);
             }
        }        }
        destroy_slp_client(client);        destroy_slp_client(client);
     }     }
Line 1195 
Line 1207 
  
    PEG_METHOD_ENTER(TRC_SERVER, "CIMServer::deregPegasus()");    PEG_METHOD_ENTER(TRC_SERVER, "CIMServer::deregPegasus()");
  
    static SLPAttrib SLPHttpAttribObj1;     SLPAttrib SLPHttpAttribObj1;
    static SLPAttrib SLPHttpsAttribObj1;     SLPAttrib SLPHttpsAttribObj1;
    struct slp_client *client;    struct slp_client *client;
    time_t now,last;    time_t now,last;
    lslpMsg msg_list;    lslpMsg msg_list;


Legend:
Removed from v.1.190.2.5  
changed lines
  Added in v.1.190.2.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2