diff --git a/meshcore/agentcore.h b/meshcore/agentcore.h index b883447..868d1f5 100644 --- a/meshcore/agentcore.h +++ b/meshcore/agentcore.h @@ -67,7 +67,8 @@ typedef enum MeshCommand_AuthInfo_CapabilitiesMask MeshCommand_AuthInfo_CapabilitiesMask_JAVASCRIPT = 0x10, MeshCommand_AuthInfo_CapabilitiesMask_TEMPORARY = 0x20, MeshCommand_AuthInfo_CapabilitiesMask_RECOVERY = 0x40, - MeshCommand_AuthInfo_CapabilitiesMask_COMPRESSION = 0x80 + MeshCommand_AuthInfo_CapabilitiesMask_RESERVED = 0x80, + MeshCommand_AuthInfo_CapabilitiesMask_COMPRESSION = 0x100 }MeshCommand_AuthInfo_CapabilitiesMask; typedef enum AgentIdentifiers diff --git a/microstack/ILibParsers.c b/microstack/ILibParsers.c index 8d66690..0f72a3a 100644 --- a/microstack/ILibParsers.c +++ b/microstack/ILibParsers.c @@ -3290,6 +3290,13 @@ ILibTransport_DoneState ILibChain_WriteEx2(void *chain, HANDLE h, OVERLAPPED *p, return(ILibTransport_DoneState_COMPLETE); } } + +void ILibChain_ReadEx2_UnwindHandler(void *chain, void *user) +{ + ILibChain_ReadEx_data *state = (ILibChain_ReadEx_data*)user; + state->handler(chain, state->fileHandle, ILibWaitHandle_ErrorStatus_NONE, state->buffer, (int)(uintptr_t)state->p, state->user); + free(state); +} void ILibChain_ReadEx2(void *chain, HANDLE h, OVERLAPPED *p, char *buffer, int bufferLen, ILibChain_ReadEx_Handler handler, void *user, char *metadata) { DWORD bytesRead = 0; @@ -3318,7 +3325,18 @@ void ILibChain_ReadEx2(void *chain, HANDLE h, OVERLAPPED *p, char *buffer, int b { if (bytesRead > 0) { - if (handler != NULL) { handler(chain, h, ILibWaitHandle_ErrorStatus_NONE, buffer, bytesRead, user); } + if (handler != NULL) + { + ILibChain_ReadEx_data *state; + ILibMemory_AllocateRaw(state, sizeof(ILibChain_ReadEx_data)); + state->buffer = buffer; + state->handler = handler; + state->fileHandle = h; + state->user = user; + state->p = (void*)(uintptr_t)bufferLen; + + ILibChain_RunOnMicrostackThreadEx2(chain, ILibChain_ReadEx2_UnwindHandler, state, 1); + } } else {