1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 00:03:45 +00:00

1. Updated error handling for MeshInfo_GetSystemInformation

2. Fixed missing ILibSpinLock declaration
3. Fixed compiler warning
This commit is contained in:
Bryan Roe
2020-12-02 15:58:08 -08:00
parent 4cc92a2d59
commit 30363a70f1
3 changed files with 10 additions and 12 deletions

View File

@@ -467,25 +467,25 @@ int info_GetLocalInterfaces(char* data, int maxdata)
int MeshInfo_GetSystemInformation(char** data)
{
int ptr = 0;
int r;
// Setup the response
if ((*data = (char*)malloc(65536)) == NULL) { ILIBCRITICALEXIT(254); }
ptr += sprintf_s(*data + ptr, 65536 - ptr, "{\"netif\":[");
ptr += info_GetLocalInterfaces(*data + ptr, 65536 - ptr);
ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}");
if (ptr < 65535)
ptr += (r = info_GetLocalInterfaces(*data + ptr, 65536 - ptr));
if ((ptr += sprintf_s(*data + ptr, 65536 - ptr, "]}")) < 0 || r == 0)
{
free(*data);
*data = NULL;
return(0);
}
else
{
(*data)[ptr] = 0;
if ((*data = realloc(*data, ptr + 1)) == NULL) { ILIBCRITICALEXIT(254); }
return ptr;
}
else
{
free(*data);
*data = NULL;
return(0);
}
}

View File

@@ -182,7 +182,7 @@ typedef struct ILibAsyncSocketModule
struct ILibAsyncSocket_SendData *PendingSend_Head;
struct ILibAsyncSocket_SendData *PendingSend_Tail;
sem_t SendLock;
ILibSpinLock SendLock;
int MaxBufferSize;
int MaxBufferSizeExceeded;

View File

@@ -3628,8 +3628,6 @@ void ILibChain_PartialStart(void *Chain)
{
if (Chain == NULL) { return; }
ILibBaseChain *chain = (ILibBaseChain*)Chain;
ILibChain_Link *module;
ILibChain_Link_Hook *nodeHook;
#ifdef WIN32
memset(chain->WaitHandles, 0, sizeof(chain->WaitHandles));