1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-27 21:53:20 +00:00

1. Fixed edge case bug, where TLS packet was corrupt

2. Added compile switch for KVM ALL TILES
3. Added compile switch for Debug fragmentation of Sends
4. Fixed compiler warnings
5. Added comments to makefile
This commit is contained in:
Bryan Roe
2020-04-13 20:08:32 -07:00
parent 2da776ab5e
commit e3b8cc4d2c
7 changed files with 90 additions and 16 deletions

View File

@@ -28,6 +28,12 @@ limitations under the License.
int KVM_Listener_FD = -1;
#define KVM_Listener_Path "/usr/local/mesh_services/meshagent/kvm"
#if defined(_TLSLOG)
#define TLSLOG1 printf
#else
#define TLSLOG1(...) ;
#endif
int KVM_AGENT_FD = -1;
int KVM_SEND(char *buffer, int bufferLen)
@@ -488,12 +494,17 @@ void* kvm_server_mainloop(void* param)
ILibQueue_UnLock(g_messageQ);
for (r = 0; r < TILE_HEIGHT_COUNT; r++) {
for (c = 0; c < TILE_WIDTH_COUNT; c++) {
for (r = 0; r < TILE_HEIGHT_COUNT; r++)
{
for (c = 0; c < TILE_WIDTH_COUNT; c++)
{
g_tileInfo[r][c].flag = TILE_TODO;
#ifdef KVM_ALL_TILES
g_tileInfo[r][c].crc = 0xFF;
#endif
}
}
//senddebug(2);
screen_num = CGMainDisplayID();
if (screen_num == 0) { g_shutdown = 1; senddebug(-2); break; }
@@ -538,8 +549,6 @@ void* kvm_server_mainloop(void* param)
fsync(STDOUT_FILENO);
}
for (y = 0; y < TILE_HEIGHT_COUNT; y++)
{
for (x = 0; x < TILE_WIDTH_COUNT; x++) {
@@ -642,7 +651,9 @@ void kvm_relay_StdOutHandler(ILibProcessPipe_Process sender, char *buffer, int b
if (bufferLen >= (8 + (int)ntohl(((unsigned int*)(buffer))[1])))
{
*bytesConsumed = 8 + (int)ntohl(((unsigned int*)(buffer))[1]);
TLSLOG1("<< KVM/WRITE: %d bytes\n", *bytesConsumed);
writeHandler(buffer, *bytesConsumed, reserved);
//printf("JUMBO PACKET: %d\n", *bytesConsumed);
return;
}