version 1.237.2.2, 2012/02/15 17:47:26
|
version 1.237.2.3, 2013/06/03 22:37:02
|
|
|
n); | n); |
ConfigManager::getInstance()->initCurrentValue(propName, String(startP, n)); | ConfigManager::getInstance()->initCurrentValue(propName, String(startP, n)); |
} | } |
|
static void _restrictListening( |
|
ConfigManager* configManager, |
|
const String &listenOn, |
|
const Uint32 &portNumberHttp, |
|
const Boolean useSSL) |
|
{ |
|
static Array<HostAddress> laddr = configManager ->getListenAddress( |
|
listenOn); |
|
for(Uint32 i = 0, n = laddr.size(); i < n; ++i) |
|
{ |
|
if(laddr[i].getAddressType() == HostAddress::AT_IPV6) |
|
{ |
|
#ifdef PEGASUS_ENABLE_IPV6 |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, |
|
portNumberHttp, useSSL, |
|
&laddr[i]); |
|
#endif |
|
} |
|
else if(laddr[i].getAddressType() == HostAddress::AT_IPV4) |
|
{ |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, |
|
portNumberHttp, useSSL, |
|
&laddr[i]); |
|
} |
|
} |
|
} |
| |
///////////////////////////////////////////////////////////////////////// | ///////////////////////////////////////////////////////////////////////// |
// MAIN | // MAIN |
|
|
_cimServerProcess->getCompleteVersion() << endl; | _cimServerProcess->getCompleteVersion() << endl; |
#endif | #endif |
| |
|
// Force initialization of hostname and fullyQualifiedHostName through |
|
// retrieving current value from Configuration Manager |
|
// - this will run getCurrentValue() in DefaultPropertyOwner.cpp |
|
configManager->getCurrentValue("hostname"); |
|
configManager->getCurrentValue("fullyQualifiedHostName"); |
|
|
// reset message loading to NON-process locale | // reset message loading to NON-process locale |
MessageLoader::_useProcessLocale = false; | MessageLoader::_useProcessLocale = false; |
| |
|
|
{ | { |
Uint32 portNumberHttp = 0; | Uint32 portNumberHttp = 0; |
String httpPort = configManager->getCurrentValue("httpPort"); | String httpPort = configManager->getCurrentValue("httpPort"); |
if (httpPort == String::EMPTY) |
if (httpPort.size() == 0) |
{ | { |
// | // |
// Look up the WBEM-HTTP port number | // Look up the WBEM-HTTP port number |
|
|
} | } |
else | else |
{ | { |
// |
Uint64 longNumber; |
// user-specified |
// use the current value which has been checked for validity at |
// |
// load(fct. GetOptions), see DefaultPropertyOwner::isValid() |
CString portString = httpPort.getCString(); |
StringConversion::decimalStringToUint64( |
char* end = 0; |
httpPort.getCString(), |
portNumberHttp = strtol(portString, &end, 10); |
longNumber); |
if (!(end != 0 && *end == '\0')) |
portNumberHttp = longNumber & 0xffff; |
{ |
|
throw InvalidPropertyValue("httpPort", httpPort); |
|
} |
|
} | } |
| |
|
String listenOn = configManager->getCurrentValue("listenAddress"); |
|
if(String::equalNoCase(listenOn, "All")) |
|
{ |
if (addIP6Acceptor) | if (addIP6Acceptor) |
{ | { |
_cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, | _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, |
|
|
_cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, | _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, |
portNumberHttp, false); | portNumberHttp, false); |
} | } |
|
} |
|
else // Restricted listening |
|
{ |
|
_restrictListening( |
|
configManager, listenOn, portNumberHttp, false); |
|
} |
|
|
// The port number is converted to a string to avoid the | // The port number is converted to a string to avoid the |
// addition of localized characters (e.g., "5,988"). | // addition of localized characters (e.g., "5,988"). |
char scratchBuffer[22]; | char scratchBuffer[22]; |
|
|
{ | { |
Uint32 portNumberHttps = 0; | Uint32 portNumberHttps = 0; |
String httpsPort = configManager->getCurrentValue("httpsPort"); | String httpsPort = configManager->getCurrentValue("httpsPort"); |
if (httpsPort == String::EMPTY) |
if (httpsPort.size() == 0) |
{ | { |
// | // |
// Look up the WBEM-HTTPS port number | // Look up the WBEM-HTTPS port number |
|
|
} | } |
else | else |
{ | { |
// |
Uint64 longNumber; |
// user-specified |
// use the current value which has been checked for validity at |
// |
// load(fct. GetOptions), see DefaultPropertyOwner::isValid() |
CString portString = httpsPort.getCString(); |
StringConversion::decimalStringToUint64( |
char* end = 0; |
httpsPort.getCString(), |
portNumberHttps = strtol(portString, &end, 10); |
longNumber); |
if (!(end != 0 && *end == '\0')) |
portNumberHttps = longNumber & 0xffff; |
{ |
|
throw InvalidPropertyValue("httpsPort", httpsPort); |
|
} |
|
} | } |
|
|
|
String listenOn = configManager->getCurrentValue("listenAddress"); |
|
if(String::equalNoCase(listenOn, "All")) |
|
{ |
if (addIP6Acceptor) | if (addIP6Acceptor) |
{ | { |
_cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, | _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, |
|
|
_cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, | _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, |
portNumberHttps, true); | portNumberHttps, true); |
} | } |
|
} |
|
else //Restricted |
|
{ |
|
_restrictListening( |
|
configManager, listenOn, portNumberHttps, true); |
|
} |
|
|
// The port number is converted to a string to avoid the | // The port number is converted to a string to avoid the |
// addition of localized characters (e.g., "5,989"). | // addition of localized characters (e.g., "5,989"). |
char scratchBuffer[22]; | char scratchBuffer[22]; |