Commit a08d9ed7 authored by jperaldi's avatar jperaldi

taking into account last update on acp interface

parent c074d146
...@@ -22,5 +22,5 @@ ...@@ -22,5 +22,5 @@
#pragma once #pragma once
#define ACP_VERSION "1.1.29" #define ACP_VERSION "1.1.28"
#define ACP_VERSION_CKSM "fce675048bccd39ca79311a03f12bdd1" #define ACP_VERSION_CKSM "01bfe1148b1d1d79347f9fe25b0e0c8f"
...@@ -98,7 +98,7 @@ int acpCreateCtx(acpCtx_t* ctx) ...@@ -98,7 +98,7 @@ int acpCreateCtx(acpCtx_t* ctx)
} }
if (acp_printPrettyMessages) { if (acp_printPrettyMessages) {
adbgSetPrintLogFormat(ctx, true); adbgSetPrintLogFormat(*ctx, true);
} }
return 0; return 0;
......
...@@ -407,7 +407,7 @@ int acpRecvMsgInternal(int sock, size_t* size, unsigned char* buffer) ...@@ -407,7 +407,7 @@ int acpRecvMsgInternal(int sock, size_t* size, unsigned char* buffer)
int acpSendMsgInternal(int sock, size_t size, const unsigned char* buffer) int acpSendMsgInternal(int sock, size_t size, const unsigned char* buffer)
{ {
SIDL_ASSERT(buffer); SIDL_ASSERT(buffer);
#ifdef ACP_DEBUG_TRACE_FLOOD #ifdef ACP_DEBUG_TRACE_FLOOD
ACP_DEBUG_ENTER_TRACE_LOG(); ACP_DEBUG_ENTER_TRACE_LOG();
#endif #endif
...@@ -415,6 +415,7 @@ int acpSendMsgInternal(int sock, size_t size, const unsigned char* buffer) ...@@ -415,6 +415,7 @@ int acpSendMsgInternal(int sock, size_t size, const unsigned char* buffer)
ACP_DEBUG_EXIT_TRACE_LOG("ACP_ERR_INTERNAL"); ACP_DEBUG_EXIT_TRACE_LOG("ACP_ERR_INTERNAL");
return -ACP_ERR_INTERNAL; return -ACP_ERR_INTERNAL;
} }
#ifdef ACP_DEBUG_TRACE_FLOOD #ifdef ACP_DEBUG_TRACE_FLOOD
ACP_DEBUG_EXIT_TRACE_LOG(NULL); ACP_DEBUG_EXIT_TRACE_LOG(NULL);
#endif #endif
......
...@@ -73,18 +73,21 @@ void adbgSetLogger(acpCtx_t ctx, adbgLogger_t logger, size_t size) ...@@ -73,18 +73,21 @@ void adbgSetLogger(acpCtx_t ctx, adbgLogger_t logger, size_t size)
} }
if (logger) { if (logger) {
if (ACP_CTX_CAST(ctx)->logger) {
SIDL_ASSERT(!ACP_CTX_CAST(ctx)->logger);
}
ACP_CTX_CAST(ctx)->logger = logger; ACP_CTX_CAST(ctx)->logger = logger;
} }
if (size) { if (size) {
if (ACP_CTX_CAST(ctx)->logBuf) {
SIDL_ASSERT(!ACP_CTX_CAST(ctx)->logBuf);
}
ACP_CTX_CAST(ctx)->logBuf = (unsigned char*)acpMalloc(size); ACP_CTX_CAST(ctx)->logBuf = (unsigned char*)acpMalloc(size);
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logBuf); SIDL_ASSERT(ACP_CTX_CAST(ctx)->logBuf);
ACP_CTX_CAST(ctx)->logBufMaxSize = size;
ACP_CTX_CAST(ctx)->logBufSize = 0; ACP_CTX_CAST(ctx)->logBufSize = 0;
} else {
ACP_CTX_CAST(ctx)->logBuf = NULL;
} }
ACP_CTX_CAST(ctx)->logBufMaxSize = size;
} }
static void adbgCheckAndSetLogger(acpCtx_t ctx) static void adbgCheckAndSetLogger(acpCtx_t ctx)
...@@ -120,10 +123,6 @@ void adbgPrintLog(acpCtx_t ctx, const char* fmt, ...) ...@@ -120,10 +123,6 @@ void adbgPrintLog(acpCtx_t ctx, const char* fmt, ...)
return; return;
} }
if (ACP_CTX_CAST(ctx)->logBufMaxSize == 0 || ACP_CTX_CAST(ctx)->logBuf == NULL) {
return;
}
adbgCheckAndSetLogger(ctx); adbgCheckAndSetLogger(ctx);
if (fmt) { if (fmt) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment