1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-09 12:03:41 +00:00

1. Updated ILibProcessPipe, so that buffer will grow as necessary

2. Updated Windows KVM, to add an accumulator for JUMBO commands
This commit is contained in:
Bryan Roe
2019-02-06 16:32:31 -08:00
parent 8d8099f0d4
commit ae72740a18
2 changed files with 38 additions and 17 deletions

View File

@@ -1010,12 +1010,27 @@ void kvm_relay_StdOutHandler(ILibProcessPipe_Process sender, char *buffer, int b
if (bufferLen > 4)
{
size = ntohs(((unsigned short*)(buffer))[1]);
if (size <= bufferLen)
if (ntohs(((unsigned short*)(buffer))[0]) == (unsigned short)MNG_JUMBO)
{
*bytesConsumed = size;
writeHandler(buffer, size, reserved);
return;
if (bufferLen > 8)
{
if (bufferLen >= (8 + (int)ntohl(((unsigned int*)(buffer))[1])))
{
*bytesConsumed = 8 + (int)ntohl(((unsigned int*)(buffer))[1]);
writeHandler(buffer, *bytesConsumed, reserved);
return;
}
}
}
else
{
size = ntohs(((unsigned short*)(buffer))[1]);
if (size <= bufferLen)
{
*bytesConsumed = size;
writeHandler(buffer, size, reserved);
return;
}
}
}
*bytesConsumed = 0;