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:
@@ -50,16 +50,28 @@
|
||||
// printf("PwdMech %s", printBuff); \
|
||||
// } \
|
||||
//}
|
||||
#define DbgTrace(LEVEL, X, Y) { \
|
||||
char formatBuff[128]; \
|
||||
char printBuff[256]; \
|
||||
if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||
{ \
|
||||
strcpy(formatBuff, "CASA_PwdMech "); \
|
||||
strncat(formatBuff, X, sizeof(formatBuff) - 8); \
|
||||
_snprintf(printBuff, sizeof(printBuff), formatBuff, Y); \
|
||||
OutputDebugString(printBuff); \
|
||||
} \
|
||||
extern char *pPwdMechDebugLogFilePath;
|
||||
#define DbgTrace(LEVEL, X, Y) { \
|
||||
char formatBuff[128]; \
|
||||
char printBuff[256]; \
|
||||
FILE *pDebugFile; \
|
||||
if (LEVEL == 0 || PwdMechDebugLevel >= LEVEL) \
|
||||
{ \
|
||||
strcpy(formatBuff, "CASA_PwdMech "); \
|
||||
strncat(formatBuff, X, sizeof(formatBuff) - 8); \
|
||||
_snprintf(printBuff, sizeof(printBuff), formatBuff, Y); \
|
||||
if (pPwdMechDebugLogFilePath) \
|
||||
{ \
|
||||
pDebugFile = fopen(pPwdMechDebugLogFilePath, "a+"); \
|
||||
if (pDebugFile) \
|
||||
{ \
|
||||
fwrite(printBuff, strlen(printBuff), 1, pDebugFile); \
|
||||
fclose(pDebugFile); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
OutputDebugString(printBuff); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define INT32_MAX (2147483647)
|
||||
|
||||
Reference in New Issue
Block a user