From 3ad4532bb952dbcb28a2b9fa72d7f1f87b5f8fd4 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 10 Sep 2013 17:04:06 +0800 Subject: [PATCH] Usermode/AxWin3 - Fixed dropped messages due to small buffer size --- Usermode/Applications/axwin3_src/WM/ipc.c | 10 ++++++++-- Usermode/Applications/axwin3_src/WM/ipc_acess.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Usermode/Applications/axwin3_src/WM/ipc.c b/Usermode/Applications/axwin3_src/WM/ipc.c index 7155c115..9cf68e8a 100644 --- a/Usermode/Applications/axwin3_src/WM/ipc.c +++ b/Usermode/Applications/axwin3_src/WM/ipc.c @@ -471,10 +471,16 @@ void IPC_Handle(tIPC_Client *Client, size_t MsgLen, tAxWin_IPCMessage *Msg) // _SysDebug("IPC_Handle: (IPCType=%p, Ident=%p, MsgLen=%i, Msg=%p)", // IPCType, Ident, MsgLen, Msg); - if( MsgLen < sizeof(tAxWin_IPCMessage) ) + if( MsgLen < sizeof(*Msg) ) { + _SysDebug("IPC_Handle: %p Dropped full undersize message (%i < %i)", + Client, MsgLen, sizeof(*Msg)); return ; - if( MsgLen < sizeof(tAxWin_IPCMessage) + Msg->Size ) + } + if( MsgLen < sizeof(*Msg) + Msg->Size ) { + _SysDebug("IPC_Handle: %p Dropped undersize message (%i < %i+%i)", + Client, MsgLen, sizeof(*Msg), Msg->Size); return ; + } if( Msg->Flags & IPCMSG_FLAG_RENDERER ) { diff --git a/Usermode/Applications/axwin3_src/WM/ipc_acess.c b/Usermode/Applications/axwin3_src/WM/ipc_acess.c index 534d53d4..700b60f4 100644 --- a/Usermode/Applications/axwin3_src/WM/ipc_acess.c +++ b/Usermode/Applications/axwin3_src/WM/ipc_acess.c @@ -12,7 +12,7 @@ #include // === CONSTANTS === -#define STATICBUF_SIZE 64 +#define STATICBUF_SIZE 256 #define AXWIN_PORT 4101 // === PROTOTYPES === -- 2.20.1