1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Fixed bug in unshift() logic in do/while loop on windows IPC

This commit is contained in:
Bryan Roe
2020-07-29 13:25:40 -07:00
parent d56dd0b308
commit f2eb015b2a

View File

@@ -929,6 +929,7 @@ BOOL ILibDuktape_server_ipc_ReadSink(void *chain, HANDLE h, ILibWaitHandle_Error
ILibDuktape_DuplexStream_WriteData(winIPC->ds, winIPC->buffer + winIPC->bufferOffset, winIPC->totalRead);
}
if (winIPC->unshiftedBytes > winIPC->totalRead) { winIPC->unshiftedBytes = winIPC->totalRead; }
consumed = winIPC->totalRead - winIPC->unshiftedBytes;
winIPC->bufferOffset += (winIPC->totalRead - winIPC->unshiftedBytes);
winIPC->totalRead -= (winIPC->totalRead - winIPC->unshiftedBytes);
} while (winIPC->paused == 0 && consumed != 0 && winIPC->totalRead > 0);