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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user