version 1.47, 2007/05/25 20:48:45
|
version 1.48, 2007/06/26 20:26:16
|
|
|
#include <Pegasus/Common/SSLContext.h> | #include <Pegasus/Common/SSLContext.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
|
#include <Pegasus/Common/HostLocator.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, msg); | throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, msg); |
} | } |
| |
bool parseError = false; |
HostLocator addr(destStr.subString(0, destStr.find("/"))); |
colon = destStr.find (":"); |
char hostName[PEGASUS_MAXHOSTNAMELEN]; |
// |
if (addr.isValid()) |
// get hostname and port number from destination string |
|
// |
|
if (colon != PEG_NOT_FOUND) |
|
{ | { |
hostStr = destStr.subString (0, colon); |
strcpy(hostName, addr.getHost().getCString()); |
destStr = destStr.subString(colon + 1, PEG_NOT_FOUND); |
if (addr.isPortSpecified()) |
String portStr = destStr.subString (0, destStr.find ("/")); |
|
|
|
char dummy; |
|
int noOfConversions = sscanf(portStr.getCString (), "%u%c", |
|
&portNumber, &dummy); |
|
parseError = (noOfConversions != 1); |
|
} |
|
// |
|
// There is no port number in the destination string, |
|
// get port number from system |
|
// |
|
else |
|
{ | { |
hostStr = destStr.subString(0, destStr.find ("/")); |
portNumber = addr.getPort(); |
if (useHttps) |
} |
|
else if (useHttps) |
{ | { |
portNumber = System::lookupPort(WBEM_HTTPS_SERVICE_NAME, | portNumber = System::lookupPort(WBEM_HTTPS_SERVICE_NAME, |
WBEM_DEFAULT_HTTPS_PORT); | WBEM_DEFAULT_HTTPS_PORT); |
|
|
WBEM_DEFAULT_HTTP_PORT); | WBEM_DEFAULT_HTTP_PORT); |
} | } |
} | } |
|
else |
char hostName[PEGASUS_MAXHOSTNAMELEN]; |
|
if (!parseError) |
|
{ |
|
char dummy; |
|
int noOfConversions = sscanf(hostStr.getCString (), "%s%c", |
|
hostName, &dummy); |
|
parseError = (noOfConversions != 1); |
|
} |
|
|
|
if (parseError) |
|
{ | { |
String msg = _getMalformedExceptionMsg(dest); | String msg = _getMalformedExceptionMsg(dest); |
| |