Continued development of AuthenticationToken Validation Service.
This commit is contained in:
		| @@ -447,10 +447,12 @@ CChannel::connectionThread( | ||||
|  | ||||
|                         DbgTrace(2, "CChannel::connectionThread- Processing Request Data Packet, Obj = %08X\n", pCChannel); | ||||
|  | ||||
|                         // Allocate a buffer big enough to receive the payload | ||||
|                         pRecvBuff = (char*) malloc(payloadLength); | ||||
|                         // Allocate a buffer big enough to receive the payload. Allow space to NULL terminate. | ||||
|                         pRecvBuff = (char*) malloc(payloadLength + 1); | ||||
|                         if (pRecvBuff != NULL) | ||||
|                         { | ||||
|                            pRecvBuff[payloadLength] = '\0'; | ||||
|  | ||||
|                            // Buffer allocated, receive the request payload. | ||||
|                            while (1) | ||||
|                            { | ||||
|   | ||||
| @@ -380,6 +380,11 @@ IpcClientSubmitReq( | ||||
| //                               pointer to the buffer containing the data | ||||
| //                               received from the server. | ||||
| // | ||||
| //                               The returned buffer always contains a NULL after the | ||||
| //                               data indicated. You may be able to leverage this to | ||||
| //                               treat the data as a NULL terminated string in cases | ||||
| //                               where the request consists of ASCII characters. | ||||
| //  | ||||
| //                pServerDataLen - Pointer to variable that will receive the | ||||
| //                                 length of the data received from the server. | ||||
| // | ||||
| @@ -388,7 +393,10 @@ IpcClientSubmitReq( | ||||
| // | ||||
| // Abstract:      Method to submit a request. | ||||
| // | ||||
| // Note: The routine blocks until the request completes. | ||||
| // Notes:         The routine blocks until the request completes. | ||||
| //  | ||||
| //                The buffer returned with the server data must be released | ||||
| //                by the calling application by calling free(). | ||||
| // | ||||
| // L0 | ||||
| //=======================================================================-- | ||||
|   | ||||
| @@ -157,7 +157,7 @@ ExecuteTests(void) | ||||
|    // Initialize the Client Ipc Subsystem | ||||
|    if (IpcClientInit("TestClient", | ||||
|                      true, | ||||
|                      3, | ||||
|                      DebugLevel, | ||||
|                      false) == 0) | ||||
|    { | ||||
|       // Set the server listen address | ||||
| @@ -235,6 +235,7 @@ main( | ||||
|    bool        doneScanning = false; | ||||
|    bool        invalidOption = false; | ||||
|    int         option; | ||||
|    int         initialCount; | ||||
|  | ||||
|    printf("**** Ipc Client test ****\n"); | ||||
|  | ||||
| @@ -284,7 +285,9 @@ main( | ||||
|    { | ||||
|       printf("submitReqCount = %d\n", submitReqCount); | ||||
|       printf("submitThreadCount = %d\n", submitThreadCount); | ||||
|       initialCount = submitReqCount; | ||||
|       ExecuteTests(); | ||||
|       printf("Submits issued = %d\n", initialCount - submitReqCount); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|   | ||||
| @@ -68,28 +68,19 @@ extern pthread_mutex_t interlockedMutex; | ||||
| // DbgTrace macro define | ||||
| // | ||||
| #define MAX_FORMAT_STRING_LEN 1024 | ||||
| #define DbgTrace(LEVEL, X, Y) {                                               \ | ||||
|    if (LEVEL == 0) {                                                          \ | ||||
|       char *pFormatString = new char[MAX_FORMAT_STRING_LEN];                  \ | ||||
|       if (pFormatString) {                                                    \ | ||||
|          snprintf(pFormatString, MAX_FORMAT_STRING_LEN, X, Y);                \ | ||||
|          if (UseSyslog)                                                       \ | ||||
|             syslog(LOG_USER | LOG_INFO, "%s -%s", pAppName, pFormatString);   \ | ||||
|          else                                                                 \ | ||||
|             fprintf(stderr, "%s -%s", pAppName, pFormatString);               \ | ||||
|          delete[] pFormatString;                                              \ | ||||
|       }                                                                       \ | ||||
|    } else if (DebugLevel >= LEVEL) {                                          \ | ||||
|       char *pFormatString = new char[MAX_FORMAT_STRING_LEN];                  \ | ||||
|       if (pFormatString) {                                                    \ | ||||
|          snprintf(pFormatString, MAX_FORMAT_STRING_LEN, X, Y);                \ | ||||
|          if (UseSyslog)                                                       \ | ||||
|             syslog(LOG_USER | LOG_DEBUG, "%s -%s", pAppName, pFormatString);  \ | ||||
|          else                                                                 \ | ||||
|             fprintf(stderr, "%s -%s", pAppName, pFormatString);               \ | ||||
|          delete[] pFormatString;                                              \ | ||||
|       }                                                                       \ | ||||
|    }                                                                          \ | ||||
| #define DbgTrace(LEVEL, X, Y) {                                      \ | ||||
|    if (LEVEL == 0 || DebugLevel >= LEVEL) {                          \ | ||||
|       if (UseSyslog)                                                 \ | ||||
|          syslog(LOG_USER | LOG_INFO, X, Y);                          \ | ||||
|       else {                                                         \ | ||||
|          char *pFormatString = new char[MAX_FORMAT_STRING_LEN];      \ | ||||
|          if (pFormatString) {                                        \ | ||||
|             snprintf(pFormatString, MAX_FORMAT_STRING_LEN, X, Y);    \ | ||||
|             fprintf(stderr, "%s -%s", pAppName, pFormatString);      \ | ||||
|             delete[] pFormatString;                                  \ | ||||
|          }                                                           \ | ||||
|       }                                                              \ | ||||
|    }                                                                 \ | ||||
| } | ||||
|  | ||||
| // | ||||
|   | ||||
| @@ -291,10 +291,12 @@ SChannel::connectionThread( | ||||
|  | ||||
|                         DbgTrace(2, "SChannel::connectionThread- Processing Request Data Packet, Obj = %08X\n", pSChannel); | ||||
|  | ||||
|                         // Allocate a buffer big enough to receive the payload | ||||
|                         pRecvBuff = new char[payloadLength]; | ||||
|                         // Allocate a buffer big enough to receive the payload. Allow space to NULL terminate. | ||||
|                         pRecvBuff = new char[payloadLength + 1]; | ||||
|                         if (pRecvBuff != NULL) | ||||
|                         { | ||||
|                            pRecvBuff[payloadLength] = '\0'; | ||||
|  | ||||
|                            // Buffer allocated, receive the Req payload. | ||||
|                            while (1) | ||||
|                            { | ||||
|   | ||||
| @@ -830,6 +830,10 @@ IpcServerGetRequestData( | ||||
| // Notes:         The returned buffer SHOULD NOT be released by the calling | ||||
| //                application. | ||||
| // | ||||
| //                The returned buffer always contains a NULL after the | ||||
| //                data indicated. You may be able to leverage this to | ||||
| //                treat the data as a NULL terminated string in cases | ||||
| //                where the request consists of ASCII characters. | ||||
| // L1 | ||||
| //=======================================================================-- | ||||
| { | ||||
|   | ||||
| @@ -166,7 +166,7 @@ ExecuteTests(void) | ||||
|  | ||||
|    // Initialize the Svc Ipc Subsystem | ||||
|    if (IpcServerInit("TestServer", | ||||
|                      3, | ||||
|                      DebugLevel, | ||||
|                      false) == 0) | ||||
|    { | ||||
|       // Set the server listen address | ||||
|   | ||||
		Reference in New Issue
	
	Block a user