forked from wolfSSL/wolfssl
1. Added a tag for global variables in environments where they aren't
shared across threads by default. 2. Set the Trace file and flag up with the shared flag.
This commit is contained in:
@ -129,8 +129,8 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
static int TraceOn = 0; /* Trace is off by default */
|
||||
static FILE* TraceFile = 0;
|
||||
static WOLFSSL_SHARED int TraceOn = 0; /* Trace is off by default */
|
||||
static WOLFSSL_SHARED FILE* TraceFile = 0;
|
||||
|
||||
|
||||
/* windows uses .rc table for this */
|
||||
@ -4077,12 +4077,15 @@ int ssl_FreeZeroDecodeBuffer(byte** data, int sz, char* error)
|
||||
int ssl_Trace(const char* traceFile, char* error)
|
||||
{
|
||||
if (traceFile) {
|
||||
TraceFile = fopen(traceFile, "a");
|
||||
if (!TraceFile) {
|
||||
SetError(BAD_TRACE_FILE_STR, error, NULL, 0);
|
||||
return -1;
|
||||
/* Don't try to reopen the file */
|
||||
if (TraceFile == NULL) {
|
||||
TraceFile = fopen(traceFile, "a");
|
||||
if (!TraceFile) {
|
||||
SetError(BAD_TRACE_FILE_STR, error, NULL, 0);
|
||||
return -1;
|
||||
}
|
||||
TraceOn = 1;
|
||||
}
|
||||
TraceOn = 1;
|
||||
}
|
||||
else
|
||||
TraceOn = 0;
|
||||
|
@ -18548,6 +18548,7 @@ static void test_wc_PemToDer(void)
|
||||
|
||||
if (cert_buf)
|
||||
free(cert_buf);
|
||||
printf(resultFmt, passed);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -18564,6 +18565,7 @@ static void test_wc_AllocDer(void)
|
||||
AssertIntEQ(ret, 0);
|
||||
AssertNotNull(pDer);
|
||||
wc_FreeDer(&pDer);
|
||||
printf(resultFmt, passed);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -720,6 +720,15 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
||||
will use dynamic buffer if not big enough */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CAVIUM_OCTEON
|
||||
/* By default, the OCTEON's global variables are all thread local. This
|
||||
* tag allows them to be shared between threads. */
|
||||
#include "cvmx-platform.h"
|
||||
#define WOLFSSL_SHARED CVMX_SHARED
|
||||
#else
|
||||
#define WOLFSSL_SHARED
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
Reference in New Issue
Block a user