Made the following changes:
- Use host name specified in ObtainAuthToken call instead of the
normalized host name to connect to the ATS to avoid problems
when the host name obtained through a reverse DNS lookup fails
to resolve via a forward DNS lookup.
- Added the capability log debug messages to a file.
- Added method to the ConfigIf to free memory returned by calls to
getEntryValue to avoid issues related to freeing memory allocated
with a heap different than the one owned by the library freeing
the memory.
This commit is contained in:
@@ -705,7 +705,7 @@ UnInitializeHostNameNormalization(void)
|
||||
hostNameNormalizationInitialized = FALSE;
|
||||
}
|
||||
|
||||
DbgTrace(1, "-UnInitializeHostNameNormalization- End", 0);
|
||||
DbgTrace(1, "-UnInitializeHostNameNormalization- End\n", 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,19 +49,30 @@
|
||||
// if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||
// { \
|
||||
// _snprintf(printBuff, sizeof(printBuff), X, Y); \
|
||||
// printf("CASA_AuthToken %s", printBuff); \
|
||||
// printf("CASA_AuthToken %s", printBuff); \
|
||||
// } \
|
||||
//}
|
||||
#define DbgTrace(LEVEL, X, Y) { \
|
||||
char formatBuff[128]; \
|
||||
char printBuff[256]; \
|
||||
if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||
{ \
|
||||
strcpy(formatBuff, "CASA_AuthToken "); \
|
||||
strncat(formatBuff, X, sizeof(formatBuff) - 10); \
|
||||
_snprintf(printBuff, sizeof(printBuff), formatBuff, Y); \
|
||||
OutputDebugString(printBuff); \
|
||||
} \
|
||||
#define DbgTrace(LEVEL, X, Y) { \
|
||||
char formatBuff[128]; \
|
||||
char printBuff[256]; \
|
||||
FILE *pDebugFile; \
|
||||
if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||
{ \
|
||||
strcpy(formatBuff, "CASA_AuthToken "); \
|
||||
strncat(formatBuff, X, sizeof(formatBuff) - 10); \
|
||||
_snprintf(printBuff, sizeof(printBuff), formatBuff, Y); \
|
||||
if (g_pDebugLogFilePath) \
|
||||
{ \
|
||||
pDebugFile = fopen(g_pDebugLogFilePath, "a+"); \
|
||||
if (pDebugFile) \
|
||||
{ \
|
||||
fwrite(printBuff, strlen(printBuff), 1, pDebugFile); \
|
||||
fclose(pDebugFile); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
OutputDebugString(printBuff); \
|
||||
} \
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -171,6 +171,8 @@ OpenRpcSession(
|
||||
bool success = false;
|
||||
|
||||
DbgTrace(1, "-OpenRpcSession- Start\n", 0);
|
||||
DbgTrace(2, "-OpenRpcSession- Host = %s\n", pHostName);
|
||||
DbgTrace(2, "-OpenRpcSession- HostPort = %d\n", hostPort);
|
||||
|
||||
// Allocate space for the session
|
||||
pSession = (RpcSession*) malloc(sizeof(*pSession));
|
||||
@@ -358,10 +360,6 @@ InternalRpc(
|
||||
{
|
||||
#define RPC_TARGET_FMT_STRING "CasaAuthTokenSvc/Rpc?method=%s"
|
||||
|
||||
#ifndef CASA_STATUS_INVALID_SERVER_CERTIFICATE
|
||||
#define CASA_STATUS_INVALID_SERVER_CERTIFICATE ((CasaStatus)0x00000023)
|
||||
#endif
|
||||
|
||||
CasaStatus retStatus = CASA_STATUS_SUCCESS;
|
||||
char *pRpcTarget;
|
||||
LPWSTR pWideRpcTarget;
|
||||
|
||||
Reference in New Issue
Block a user