mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 16:53:13 +00:00
1. Updated error handling for MeshInfo_GetSystemInformation
2. Fixed missing ILibSpinLock declaration 3. Fixed compiler warning
This commit is contained in:
@@ -467,25 +467,25 @@ int info_GetLocalInterfaces(char* data, int maxdata)
|
|||||||
int MeshInfo_GetSystemInformation(char** data)
|
int MeshInfo_GetSystemInformation(char** data)
|
||||||
{
|
{
|
||||||
int ptr = 0;
|
int ptr = 0;
|
||||||
|
int r;
|
||||||
|
|
||||||
// Setup the response
|
// Setup the response
|
||||||
if ((*data = (char*)malloc(65536)) == NULL) { ILIBCRITICALEXIT(254); }
|
if ((*data = (char*)malloc(65536)) == NULL) { ILIBCRITICALEXIT(254); }
|
||||||
ptr += sprintf_s(*data + ptr, 65536 - ptr, "{\"netif\":[");
|
ptr += sprintf_s(*data + ptr, 65536 - ptr, "{\"netif\":[");
|
||||||
ptr += info_GetLocalInterfaces(*data + ptr, 65536 - ptr);
|
ptr += (r = info_GetLocalInterfaces(*data + ptr, 65536 - ptr));
|
||||||
ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}");
|
if ((ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}")) < 0 || r == 0)
|
||||||
if (ptr < 65535)
|
{
|
||||||
|
free(*data);
|
||||||
|
*data = NULL;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
(*data)[ptr] = 0;
|
(*data)[ptr] = 0;
|
||||||
if ((*data = realloc(*data, ptr + 1)) == NULL) { ILIBCRITICALEXIT(254); }
|
if ((*data = realloc(*data, ptr + 1)) == NULL) { ILIBCRITICALEXIT(254); }
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
free(*data);
|
|
||||||
*data = NULL;
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ typedef struct ILibAsyncSocketModule
|
|||||||
|
|
||||||
struct ILibAsyncSocket_SendData *PendingSend_Head;
|
struct ILibAsyncSocket_SendData *PendingSend_Head;
|
||||||
struct ILibAsyncSocket_SendData *PendingSend_Tail;
|
struct ILibAsyncSocket_SendData *PendingSend_Tail;
|
||||||
sem_t SendLock;
|
ILibSpinLock SendLock;
|
||||||
|
|
||||||
int MaxBufferSize;
|
int MaxBufferSize;
|
||||||
int MaxBufferSizeExceeded;
|
int MaxBufferSizeExceeded;
|
||||||
|
|||||||
@@ -3628,8 +3628,6 @@ void ILibChain_PartialStart(void *Chain)
|
|||||||
{
|
{
|
||||||
if (Chain == NULL) { return; }
|
if (Chain == NULL) { return; }
|
||||||
ILibBaseChain *chain = (ILibBaseChain*)Chain;
|
ILibBaseChain *chain = (ILibBaseChain*)Chain;
|
||||||
ILibChain_Link *module;
|
|
||||||
ILibChain_Link_Hook *nodeHook;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
memset(chain->WaitHandles, 0, sizeof(chain->WaitHandles));
|
memset(chain->WaitHandles, 0, sizeof(chain->WaitHandles));
|
||||||
|
|||||||
Reference in New Issue
Block a user